xwt
19 小时以前 7c2192a2f000d94add173b77b6bd4c8c4fc6a5e4
pages/QC/SJ/List.vue
@@ -22,10 +22,10 @@
        <!-- 状态切换标签 -->
        <view class="status-tabs">
          <button :class="['tab-button', current === 0 ? 'active' : '']" @click="onClickItem({currentIndex: 0})">
            {{items[0]}}
            未完成({{uncheckedCount}})
          </button>
          <button :class="['tab-button', current === 1 ? 'active' : '']" @click="onClickItem({currentIndex: 1})">
            {{items[1]}}
            {{checkedCount}}
          </button>
        </view>
      </view>
@@ -36,11 +36,19 @@
      <!-- 检验单卡片 -->
      <view class="inspection-card" v-for="item in data" :key="item.id" @click="navigateToDetail(item)">
        <view class="card-header">
          <view class="header-left">
          <text class="badge normal" v-if="item.SJ_MJ">{{item.SJ_MJ}}</text>
          <text class="card-title">检验单号: {{item.billNo}}</text>
          <text class="status pass" v-if="item.result === '合格'">合格</text>
          <text class="status unqualified" v-if="item.result === '不合格'">不合格</text>
          <text class="status pending" v-if="!item.result">待检验</text>
          </view>
          <view class="header-right">
            <!-- 未完成标签页的状态显示 -->
            <text class="status pending" v-if="current === 0 && (!item.result || item.result === '未完成')">待检验</text>
            <text class="status pass" v-if="current === 0 && item.result === '合格'">合格</text>
            <text class="status unqualified" v-if="current === 0 && item.result === '不合格'">不合格</text>
            <!-- 已完成标签页的状态显示 -->
            <text class="status pass" v-if="current === 1 && item.result === '合格'">合格</text>
            <text class="status unqualified" v-if="current === 1 && item.result === '不合格'">不合格</text>
          </view>
        </view>
        <view class="card-body">
@@ -124,7 +132,10 @@
      // ===== 新增搜索功能相关数据 =====
      optionsIndex: 0, // 当前选择的查询条件索引
      options: ['工单', '检验单号', '产线', '物料编码', '物料名称'], // 查询条件选项
      selectedField: 'daa001' // 当前选择的查询字段,默认为工单
      selectedField: 'daa001', // 当前选择的查询字段,默认为工单
      // ===== 新增数量统计变量 =====
      uncheckedCount: 0, // 未完成数量
      checkedCount: '已检验' // 已完成数量显示文本
    };
  },
  onLoad() {
@@ -175,6 +186,12 @@
        }
      }).then(res => {
        this.data = res.data.tbBillList;
        // 设置数量统计
        if (this.current === 1) {
          this.checkedCount = '已检验(' + res.totalCount + ')';
        } else {
          this.uncheckedCount = res.totalCount;
        }
      })
    },
    handleFabClick() {
@@ -329,12 +346,24 @@
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.header-left {
  display: flex;
  align-items: center;
  flex: 1;
}
.header-right {
  display: flex;
  align-items: center;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  flex: 1;
  margin: 0 8px;
}