xwt
2025-08-14 62cb247da5cc1cc097c5afea402aabee05260431
pages/QC/LLJ/List.vue
@@ -30,7 +30,6 @@
         </view>
      </view>
      <!-- 检验单列表 -->
      <view class="inspection-list">
         <!-- 检验单卡片1 -->
@@ -38,10 +37,16 @@
            <view class="card-header">
               <text class="badge urgent" v-if="item.urgentFlag == 1">急料</text>
               <text class="badge urgent" v-if="item.jycs == 1">超时</text>
               <text class="badge normal" v-if="item.ftype == 1">委外</text>
               <text class="badge normal" v-if="item.first == 1">首次来料</text>
               <text class="card-title">检验单号: {{item.releaseNo}}</text>
               <text class="status pending" v-if="item.userName==null && item.activeTab==0">待分配</text>
               <view v-if="item.userName == null && item.activeTab == 0">
                       <text class="status pending" :class="{ 'emergency-pending': item.lotNo1 === '紧急放行,请勿验退!' }">
                       {{ item.lotNo1 === '紧急放行,请勿验退!' ? '紧急放行/' + getStatusText(item) : getStatusText(item) }}
                       </text>
                   </view>
               <text class="status assigned" v-if="item.userName!=null && item.activeTab==0">已分配</text>
               <text class="status pass" v-if="item.fcheckResu=='合格' && item.activeTab==1">合格</text>
               <text class="status Unqualified" v-if="item.fcheckResu=='不合格' && item.activeTab==1">不合格</text>
@@ -176,26 +181,32 @@
                  result: result,
                  SearchValue: this.searchValue,
                  selectedIndex: this.optionsIndex, //下拉框筛选条件
                  userIndex: this.projectIndex
                  userIndex: this.projectIndex,
                  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);
                     this.$set(item, 'IQCJL', this.IQCJL);
                     this.$set(item, 'EMERGENCY', item.emergency || null);
                  });
               } 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);
                        this.$set(item, 'IQCJL', this.IQCJL);
                        this.$set(item, 'EMERGENCY', item.emergency || null);
                     });
                  }
@@ -293,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") {
@@ -306,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 '待检验';
         }
      }
   }
@@ -470,6 +513,12 @@
      color: white;
   }
   .badge.emergency {
      background-color: #ff4d4f;
      color: white;
      margin-right: 5px;
   }
   .status {
      font-size: 12px;
      padding: 4px 8px;
@@ -610,5 +659,9 @@
      order: 4;
      width: 100%;
    } */
   .status.emergency-pending {
       background-color: #ff0000; /* 红色背景 */
       color: white;
   }
   }
</style>