| | |
| | | <!-- 状态切换标签 --> |
| | | <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> |
| | |
| | | <!-- 检验单卡片 --> |
| | | <view class="inspection-card" v-for="item in data" :key="item.id" @click="navigateToDetail(item)"> |
| | | <view class="card-header"> |
| | | <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 class="header-left"> |
| | | <text class="badge normal" v-if="item.SJ_MJ">{{item.SJ_MJ}}</text> |
| | | <text class="card-title">检验单号: {{item.billNo}}</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"> |
| | |
| | | // ===== 新增搜索功能相关数据 ===== |
| | | optionsIndex: 0, // 当前选择的查询条件索引 |
| | | options: ['工单', '检验单号', '产线', '物料编码', '物料名称'], // 查询条件选项 |
| | | selectedField: 'daa001' // 当前选择的查询字段,默认为工单 |
| | | selectedField: 'daa001', // 当前选择的查询字段,默认为工单 |
| | | // ===== 新增数量统计变量 ===== |
| | | uncheckedCount: 0, // 未完成数量 |
| | | checkedCount: '已检验' // 已完成数量显示文本 |
| | | }; |
| | | }, |
| | | onLoad() { |
| | |
| | | } |
| | | }).then(res => { |
| | | this.data = res.data.tbBillList; |
| | | // 设置数量统计 |
| | | if (this.current === 1) { |
| | | this.checkedCount = '已检验(' + res.totalCount + ')'; |
| | | } else { |
| | | this.uncheckedCount = res.totalCount; |
| | | } |
| | | }) |
| | | }, |
| | | handleFabClick() { |
| | |
| | | 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; |
| | | } |
| | | |