#
zhou zhou
2026-01-16 eff43fd0ea0d3051d56c2aa9827cc3081e46d865
pages/outbound/orderOut/orderList.vue
@@ -10,12 +10,12 @@
         <view class="order-card" v-for="(item,i) in matList" :key="i" @click="toPrint(item)">
            <!-- 卡片头部 -->
            <view class="card-header">
               <view class="order-badge" :class="getSettleClass(item.settle)">
                  <text class="badge-text">{{item.settle$ || '未知'}}</text>
               <view class="order-badge" :class="getSettleClass(item.exceStatus)">
                  <text class="badge-text">{{item.exceStatus$ || '未知'}}</text>
               </view>
               <view class="order-no">
                  <text class="order-no-label">单据号</text>
                  <text class="order-no-value">{{item.orderNo}}</text>
                  <text class="order-no-value">{{item.code}}</text>
               </view>
            </view>
            
@@ -24,14 +24,25 @@
               <view class="info-row">
                  <view class="info-item">
                     <text class="info-label">单据类型</text>
                     <text class="info-value">{{item.docType$ || '-'}}</text>
                     <text class="info-value">{{item.wkType$ || '-'}}</text>
                  </view>
                  <!-- <view class="info-item">
                     <text class="info-label">应出数量</text>
                     <text class="info-value">{{item.anfme || '-'}}</text>
                  </view> -->
               </view>
               <view class="info-row">
                  <view class="info-item">
                     <text class="info-label">应出数量</text>
                     <text class="info-value">{{item.anfme || '-'}}</text>
                  </view>
                  <view class="info-item">
                     <text class="info-label">仓库</text>
                     <text class="info-value">{{item.itemName || '-'}}</text>
                     <text class="info-label">完成数量</text>
                     <text class="info-value">{{item.qty || '-'}}</text>
                  </view>
               </view>
            </view>
            
            <!-- 卡片底部 -->
            <view class="card-footer">
@@ -54,6 +65,7 @@
</template>
<script>
   import { request } from '@/common/request.js'
   export default {
      data() {
         return {
@@ -62,8 +74,7 @@
            condition: '',
            loading: false,
            curr: 1,
            baseUrl: '',
            token: '',
            limit:5,
            status: 'more',
            contentText: {
               contentdown: '上拉加载更多',
@@ -96,8 +107,6 @@
         }
      },
      onShow() {
         this.baseUrl = uni.getStorageSync('baseUrl');
         this.token = uni.getStorageSync('token');
         // 每次进入页面重新加载
         this.refreshData();
      },
@@ -115,90 +124,72 @@
            this.fetchOrderList(false);
         },
         // 获取订单列表
         fetchOrderList(isRefresh) {
            let that = this;
            uni.request({
               url: that.baseUrl + '/order/pakin/order/list/pda/page/auth',
               data: {
                  curr: that.curr,
                  limit: 20,
                  tagId: that.tagIdNow
               },
               method: "GET",
               header: {
                  'token': uni.getStorageSync('token'),
               },
               success(result) {
                  var res = result.data;
                  if (res.code === 200) {
                     let records = res.data.records || [];
                     if (records.length > 0) {
                        if (isRefresh) {
                           that.matList = records;
                        } else {
                           that.matList = that.matList.concat(records);
                        }
                        that.curr = that.curr + 1;
                        that.status = 'more';
         async fetchOrderList(isRefresh) {
            try {
               const res = await request('/orderOut/list', {
                  curr: this.curr,
                  limit: this.limit,
                  orderNo: this.condition
               }, 'GET', true);
               if (res.code === 200) {
                  let records = res.data.records || [];
                  if (records.length > 0) {
                     if (isRefresh) {
                        this.matList = records;
                     } else {
                        that.status = 'noMore';
                        this.matList = this.matList.concat(records);
                     }
                  } else if (res.code === 403) {
                     uni.showToast({ title: res.msg, icon: "none", position: 'top' });
                     setTimeout(() => {
                        uni.reLaunch({ url: '../login/login' });
                     }, 1000);
                     this.curr = this.curr + 1;
                     this.status = 'more';
                  } else {
                     uni.showToast({ title: res.msg, icon: "none", position: 'top' });
                     this.status = 'noMore';
                  }
               },
               fail(err) {
                  uni.showToast({ title: '网络请求失败', icon: "none", position: 'top' });
               },
               complete() {
                  that.loading = false;
                  uni.stopPullDownRefresh();
               } else if (res.code === 403) {
                  uni.showToast({ title: res.msg, icon: "none", position: 'top' });
                  setTimeout(() => {
                     uni.reLaunch({ url: '../login/login' });
                  }, 1000);
               } else {
                  uni.showToast({ title: res.msg, icon: "none", position: 'top' });
               }
            });
            } catch (err) {
               // request.js 已经处理了错误提示
            } finally {
               this.loading = false;
               uni.stopPullDownRefresh();
            }
         },
         // 搜索
         search() {
         async search() {
            if (!this.condition.trim()) {
               this.refreshData();
               return;
            }
            let that = this;
            that.loading = true;
            uni.request({
               url: that.baseUrl + '/order/search/pda/auth',
               data: {
                  condition: that.condition
               },
               method: "GET",
               header: {
                  'token': uni.getStorageSync('token'),
               },
               success(result) {
                  var res = result.data;
                  if (res.code === 200) {
                     that.matList = res.data || [];
                     that.status = 'noMore';
                  } else if (res.code === 403) {
                     uni.showToast({ title: res.msg, icon: "none", position: 'top' });
                     setTimeout(() => {
                        uni.reLaunch({ url: '../login/login' });
                     }, 1000);
                  } else {
                     uni.showToast({ title: res.msg, icon: "none", position: 'top' });
                  }
               },
               fail() {
                  uni.showToast({ title: '搜索请求失败', icon: "none", position: 'top' });
               },
               complete() {
                  that.loading = false;
            this.loading = true;
            try {
               const res = await request('/orderOut/list', {
                  curr: this.curr,
                  limit: this.limit,
                  orderNo: this.condition
               }, 'GET', true);
               if (res.code === 200) {
                  this.matList = res.data || [];
                  this.status = 'noMore';
               } else if (res.code === 403) {
                  uni.showToast({ title: res.msg, icon: "none", position: 'top' });
                  setTimeout(() => {
                     uni.reLaunch({ url: '../login/login' });
                  }, 1000);
               } else {
                  uni.showToast({ title: res.msg, icon: "none", position: 'top' });
               }
            });
            } catch (err) {
               // request.js 已经处理了错误提示
            } finally {
               this.loading = false;
            }
         },
         // 取消搜索
         onCancelSearch() {
@@ -220,7 +211,7 @@
         toPrint(item) {
            let that = this;
            uni.navigateTo({
               url: "../order/orderDetlList",
               url: "./orderDetlList",
               success: function(res) {
                  res.eventChannel.emit('data', {
                     data: item
@@ -243,14 +234,14 @@
   
   .page-container {
      min-height: 100vh;
      background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
      background: #f5f7fa;
      padding-bottom: 20rpx;
   }
   
   .search-bar {
      padding: 0rpx 14rpx;
      padding: 0rpx 8rpx;
      background: #ffffff;
      box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
      box-shadow: 0 2rpx 12rpx rgba(0, 129, 255, 0.08);
   }
   
   .order-list {
@@ -261,21 +252,22 @@
      background: #ffffff;
      border-radius: 16rpx;
      margin-top: 20rpx;
      box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.08);
      box-shadow: 0 4rpx 20rpx rgba(0, 129, 255, 0.1);
      overflow: hidden;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      border: 1rpx solid #e4e7ed;
   }
   
   .order-card:active {
      transform: scale(0.98);
      box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.12);
      box-shadow: 0 2rpx 10rpx rgba(0, 129, 255, 0.15);
   }
   
   .card-header {
      display: flex;
      align-items: center;
      padding: 24rpx 28rpx;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      background: linear-gradient(135deg, #0081ff 0%, #1890ff 100%);
   }
   
   .order-badge {