xwt
2025-08-14 62cb247da5cc1cc097c5afea402aabee05260431
pages/QC/LLJ/List.vue
@@ -30,7 +30,6 @@
         </view>
      </view>
      <!-- 检验单列表 -->
      <view class="inspection-list">
         <!-- 检验单卡片1 -->
@@ -44,7 +43,7 @@
               <text class="card-title">检验单号: {{item.releaseNo}}</text>
               <view v-if="item.userName == null && item.activeTab == 0">
                       <text class="status pending" :class="{ 'emergency-pending': item.lotNo1 === '紧急放行,请勿验退!' }">
                       {{ item.lotNo1 === '紧急放行,请勿验退!' ? '紧急放行/待分配' : '待分配' }}
                       {{ item.lotNo1 === '紧急放行,请勿验退!' ? '紧急放行/' + getStatusText(item) : getStatusText(item) }}
                       </text>
                       
                   </view>
@@ -186,9 +185,12 @@
                  emergency:this.meergency,
               }
            }).then(res => {
               // 去重处理 - 根据 releaseNo 去重
               const uniqueList = this.removeDuplicatesByReleaseNo(res.data.tbBillList);
               if (this.pageIndex === 1) {
                  // 如果是第一页,直接覆盖原数据
                  this.inspectionList = res.data.tbBillList;
                  this.inspectionList = uniqueList;
                  //添加Tab信息,判断是已检还是未检数据
                  this.inspectionList.forEach((item, index) => {
                     this.$set(item, 'activeTab', this.activeTab);
@@ -197,9 +199,9 @@
                  });
               } else {
                  if (res.data.tbBillList.length > 0) {
                  if (uniqueList.length > 0) {
                     // 如果是下一页,追加新数据
                     this.inspectionList = [...this.inspectionList, ...res.data.tbBillList];
                     this.inspectionList = [...this.inspectionList, ...uniqueList];
                     //添加Tab信息,判断是已检还是未检数据
                     this.inspectionList.forEach((item, index) => {
                        this.$set(item, 'activeTab', this.activeTab);
@@ -302,10 +304,19 @@
         },
         onShow() {
            //每次进入页面都会执行的方法
            // this.pageIndex = 1;
            // this.data = [];
            // //this.current = 0
            // 检查是否需要刷新数据
            const app = getApp();
            if (app.globalData && app.globalData.needRefreshList) {
               // 清除标记
               app.globalData.needRefreshList = false;
               // 强制刷新数据
               this.pageIndex = 1; // 重置页码
               this.inspectionList = []; // 清空列表数据
               this.init(); // 重新加载数据
            } else {
               // 正常刷新
            this.init();
            }
         },
         async onLoad() {
            if (this.$loginInfo.roleid.indexOf("90134") != -1 || this.$loginInfo.account == "PL017") {
@@ -315,6 +326,29 @@
            }
            await this.init(); // 自定义的刷新函数
         },
         // 根据 releaseNo 去重的方法
         removeDuplicatesByReleaseNo(array) {
            const seen = new Set();
            return array.filter(item => {
               const releaseNo = item.releaseNo;
               if (seen.has(releaseNo)) {
                  return false;
               }
               seen.add(releaseNo);
               return true;
            });
         },
         // 根据检验项目数量获取状态文本
         getStatusText(item) {
            // 如果没有检验项目,显示"未维护"
            if (!item.inspectionItemCount || item.inspectionItemCount === 0) {
               return '未维护';
            }
            // 如果有检验项目,显示"待检验"
            return '待检验';
         }
      }
   }