xwt
2025-09-18 688505dded0a49ee685abcb980bd0dc521df4241
pages/QC/SJ/List.vue
@@ -15,8 +15,13 @@
      </view>
      
      <view class="filter-controls" style="margin-bottom: 5px;">
        <view class="dropdown-filter">
          <picker @change="onOptionsChange" :value="optionsIndex" :range="options">
            <view class="picker">{{options[optionsIndex]}}</view>
          </picker>
        </view>
        <view class="search-container">
          <input class="search-input" v-model="searchValue" placeholder="请输入检验单号或物料编码"
          <input class="search-input" v-model="searchValue" :placeholder="'请输入'+options[optionsIndex]"
            @confirm="handleSearch" />
          <button class="search-button" @click="handleSearch">搜索</button>
        </view>
@@ -34,7 +39,7 @@
          <view class="badge normal" v-if="item.isFirst == 1">首次</view>
          <view class="card-title">检验单号: {{item.billNo}}</view>
          <view class="status" :class="{'status-pending': current === 0, 'status-assigned': current === 0 && item.statusUser, 'status-pass': current === 1 && item.result === '合格', 'status-fail': current === 1 && item.result === '不合格'}">
            {{current === 0 ? (item.statusUser ? '已分配' : '未提交') : (item.result ? item.result : '已完成')}}
            {{current === 0 ? (item.statusUser ? '已分配' : '未提交') : (item.result ? item.result : '已提交')}}
          </view>
        </view>
@@ -86,10 +91,7 @@
      </view>
    </view>
    <!-- 添加按钮 -->
    <view class="plus-button" @click="handleFabClick" v-if="current === 0">
      <view class="plus-icon">+</view>
    </view>
  </view>
</template>
@@ -110,7 +112,9 @@
      tipShow: false, // 是否显示顶部提示框
      searchValue: '',
      uncheckedCount: 0,
      checkedCount: '已完成'
      checkedCount: '已完成',
      optionsIndex: 0,
      options: ['物料编号', '工单单号', '检验单号', '产线']
    };
  },
  onLoad() {
@@ -139,7 +143,9 @@
          limit: this.limit,
          statusUser: userName,
          result: result,
          searchValue: this.searchValue
          fsubmit: this.current === 0 ? 0 : 1,
          searchValue: this.searchValue,
          selectedIndex: this.optionsIndex
        }
      }).then(res => {
        if (this.pageIndex === 1) {
@@ -167,11 +173,6 @@
        this.isLoading = false; // 出现错误时结束加载
      });
    },
    handleFabClick() {
      uni.navigateTo({
        url: 'Add?id'
      });
    },
    onClickItem(index) {
      if (this.current !== index.currentIndex) {
        this.current = index.currentIndex;
@@ -179,6 +180,18 @@
        this.pageIndex = 1;
        this.init();
      }
    },
    //搜索选项变化
    onOptionsChange(e) {
      this.optionsIndex = e.detail.value;
      // 根据选择的选项设置搜索字段
      const fieldMap = {
        0: 'itemNo', // 物料编号
        1: 'daa001', // 工单单号
        2: 'billNo', // 检验单号
        3: 'line'    // 产线
      };
      this.selectedField = fieldMap[this.optionsIndex];
    },
    handleSearch() {
      this.pageIndex = 1;
@@ -233,9 +246,7 @@
}
/* 顶部筛选区 */
.filter-section {
  /* margin-bottom: 24px; */
}
.filter-section h1 {
  font-size: 24px;
@@ -281,6 +292,19 @@
.search-button:active {
  transform: translateY(0);
}
.dropdown-filter {
  min-width: 70px;
}
.picker {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  font-size: 14px;
  min-width: 120px;
}
.filter-controls {
@@ -543,33 +567,6 @@
  transform: translateY(0);
}
/* 添加按钮样式 */
.plus-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: #ffffff;
  text-align: center;
  line-height: 59px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
  transition: all 0.3s ease;
}
.plus-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(52, 152, 219, 0.5);
}
.plus-button:active {
  transform: translateY(0);
}
/* 响应式设计 */
@media (min-width: 768px) {