xwt
2025-08-14 62cb247da5cc1cc097c5afea402aabee05260431
pages/QC/LLJ/List.vue
@@ -43,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>
@@ -185,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);
@@ -196,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);
@@ -323,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 '待检验';
         }
      }
   }