fcx
2025-11-25 26bcd350d2a053000c16f4adbf70a672fcb562b8
【首检检验】平板端上方添加一个搜索框提供查询
已修改1个文件
34 ■■■■■ 文件已修改
pages/QC/SJ/ProductionLineSubmit.vue 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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>
    <!-- 头部信息 -->
@@ -123,7 +138,9 @@
      searchValue: '',
      userId: "",
      uncheckedCount: 0,
      checkedCount: 0
      checkedCount: 0,
      optionsIndex: 0, // 新增:下拉选项索引
      options: ['项目', '线体', '工单号', '物料号', '物料名'] // 新增:搜索选项
    };
  },
@@ -139,6 +156,18 @@
  },
  methods: {
    // 新增:搜索选项改变事件
    onOptionsChange(e) {
      this.optionsIndex = e.detail.value;
    },
    // 新增:搜索按钮点击事件
    handleSearch() {
      this.pageIndex = 1;
      this.data = [];
      this.init();
    },
    // Tab切换
    async switchTab(tabIndex) {
      if (this.currentTab !== tabIndex) {
@@ -164,7 +193,8 @@
            limit: this.limit,
            statusUser: userName,
            status: this.currentTab,  // 0: 未提交, 1: 已提交
            searchValue: this.searchValue
            searchValue: this.searchValue,
            selectedIndex: this.optionsIndex // 新增:传递搜索选项索引
          }
        });