fcx
2025-12-02 a177ad6532fcdc1e9d2b3910276bd88d04791469
pages/QC/SJ/ProductionLineSubmit.vue
@@ -15,6 +15,21 @@
          </button>
        </view>
      </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="'请输入'+options[optionsIndex]"
                 @confirm="handleSearch" />
          <button class="search-button" @click="handleSearch">搜索</button>
        </view>
      </view>
    </view>
    <!-- 头部信息 -->
@@ -89,12 +104,9 @@
          <!-- 已提交状态下显示检验信息 -->
          <view v-if="currentTab === 1" class="meta-info">
            <view class="meta-item">检验单号: {{ item.billNo }}</view>
         <view class="meta-item">检验人: {{ item.statusUser }}</view>
          </view>
        <view   class="meta-info">
                 <view class="meta-item">检验人: {{ item.statusUser }}</view>
        </view>
        <view v-if="currentTab === 1" class="meta-info">
           <view class="meta-item">创建时间: {{ item.createTime }}</view>
            <view v-if="item.result" class="meta-item">检验状态: {{ item.result }}</view>
@@ -126,22 +138,36 @@
      searchValue: '',
      userId: "",
      uncheckedCount: 0,
      checkedCount: 0
      checkedCount: 0,
      optionsIndex: 0, // 新增:下拉选项索引
      options: ['项目', '线体', '工单号', '物料号', '物料名'] // 新增:搜索选项
    };
  },
  // 页面加载时只执行一次
  async onLoad() {
    const user = this.$loginInfo;
    this.userId = user.account;
    console.log("用户ID =", this.userId);
    // 初始化加载数据
    await this.init();
  },
  methods: {
    // 新增:搜索选项改变事件
    onOptionsChange(e) {
      this.optionsIndex = e.detail.value;
    },
    // 新增:搜索按钮点击事件
    handleSearch() {
      this.pageIndex = 1;
      this.data = [];
      this.init();
    },
    // Tab切换
    async switchTab(tabIndex) {
      if (this.currentTab !== tabIndex) {
@@ -167,7 +193,8 @@
            limit: this.limit,
            statusUser: userName,
            status: this.currentTab,  // 0: 未提交, 1: 已提交
            searchValue: this.searchValue
            searchValue: this.searchValue,
            selectedIndex: this.optionsIndex // 新增:传递搜索选项索引
          }
        });