kyy
2025-08-29 f0ee0dda301ef09ddbf36c1699309e4dc0963e63
pages/QC/OQC/List.vue
@@ -1,7 +1,7 @@
<template>
  <view class="page-container">
    <!-- 刷新提示框 -->
    <view :class="{ 'show': tipShow }" class="success-toast">
      <view class="success-toast" :class="{ 'show': tipShow }">
      <view class="toast-icon">✓</view>
      <text class="toast-text">刷新成功</text>
    </view>
@@ -22,28 +22,42 @@
        </view>
      </view>
      <!-- 搜索栏样式 -->
      <view class="search-bar">
        <view class="search-card">
          <picker v-model="selectedOption" :range="searchOptions" mode="selector" @change="onPickerChange">
            <view class="picker">
              {{ searchOptions[selectedOption] }}
         <!-- 搜索栏 -->
         <!-- <view class="search-section"> -->
            <!-- <view class="search-container">
               <view class="search-input-wrapper">
                  <uni-icons type="search" size="18" color="#94a3b8"></uni-icons>
                  <input class="search-input" type="text" v-model="searchValue"
                     @confirm="getInputValue" placeholder="搜索检验单号、物料编码..." />
                  <view v-if="searchValue" class="clear-btn" @tap="clearSearch">
                     <uni-icons type="clear" size="16" color="#94a3b8"></uni-icons>
                  </view>
               </view>
               <view class="filter-btn" @tap="toggleFilter">
                  <uni-icons type="tune" size="18" color="#4f46e5"></uni-icons>
               </view>
            </view> -->
            <!-- 筛选器 -->
            <!-- <view v-if="showFilter" class="filter-panel">
               <picker mode="selector" :range="searchOptions" v-model="selectedOption" @change="onPickerChange">
                  <view class="filter-option">
                     <text class="filter-label">筛选条件</text>
                     <text class="filter-value">{{ searchOptions[selectedOption] }}</text>
                     <uni-icons type="arrowdown" size="14" color="#64748b"></uni-icons>
            </view>
          </picker>
          <input v-model="searchValue" class="search-input" placeholder="请输入搜索值" type="text"
                 @keypress.enter="getInputValue"/>
          <button class="search-btn" @click="getInputValue">搜索</button>
        </view>
      </view>
            </view> -->
         <!-- </view> -->
      <!-- 选项卡 -->
      <view class="tab-section">
        <view class="custom-tabs">
          <view v-for="(item, index) in items" :key="index"
                :class="{ 'active': current === index }" class="tab-item"
                  class="tab-item" :class="{ 'active': current === index }"
                @tap="onClickItem({ currentIndex: index })">
            <text class="tab-text">{{ item }}</text>
            <view v-if="current === index" class="tab-indicator"></view>
                  <view class="tab-indicator" v-if="current === index"></view>
          </view>
        </view>
      </view>
@@ -83,11 +97,11 @@
                </view>
              </view>
              <view class="header-right">
                <view :class="{
                        <view class="status-badge"
                           :class="{
                              'status-submitted': item.fsubmit == 1,
                              'status-pending': item.fsubmit != 1
                           }"
                      class="status-badge">
                           }">
                  <view class="status-dot"></view>
                  <text class="status-text">{{ item.fsubmit == 1 ? '已提交' : '待提交' }}</text>
                </view>
@@ -97,26 +111,25 @@
            <!-- 检验结果区域 -->
            <view class="inspection-result">
              <view class="result-item">
                <view :class="{
                        <view class="result-icon"
                           :class="{
                              'icon-pass': item.fcheckResu === '合格',
                              'icon-fail': item.fcheckResu === '不合格',
                              'icon-pending': !item.fcheckResu || item.fcheckResu === '未检验'
                           }"
                      class="result-icon">
                           }">
                  <text class="result-symbol">{{
                      item.fcheckResu === '合格' ? '✓' :
                          item.fcheckResu === '不合格' ? '✗' : '○'
                    }}
                  </text>
                           }}</text>
                </view>
                <view class="result-content">
                  <text class="result-label">检验结果</text>
                  <text :class="{
                           <text class="result-value"
                              :class="{
                                 'value-pass': item.fcheckResu === '合格',
                                 'value-fail': item.fcheckResu === '不合格',
                                 'value-pending': !item.fcheckResu || item.fcheckResu === '未检验'
                              }"
                        class="result-value">
                              }">
                    {{ item.fcheckResu || '未检验' }}
                  </text>
                </view>
@@ -152,7 +165,7 @@
            <!-- 操作指示器 -->
            <view class="action-indicator">
              <uni-icons color="#94a3b8" size="16" type="arrowright"></uni-icons>
                     <uni-icons type="arrowright" size="16" color="#94a3b8"></uni-icons>
            </view>
          </view>
        </view>
@@ -200,23 +213,22 @@
            <!-- 检验结果区域 -->
            <view class="inspection-result">
              <view class="result-item">
                <view :class="{
                        <view class="result-icon"
                           :class="{
                              'icon-pass': item.fcheckResu === '合格',
                              'icon-fail': item.fcheckResu === '不合格'
                           }"
                      class="result-icon">
                           }">
                  <text class="result-symbol">{{
                      item.fcheckResu === '合格' ? '✓' : '✗'
                    }}
                  </text>
                           }}</text>
                </view>
                <view class="result-content">
                  <text class="result-label">最终结果</text>
                  <text :class="{
                           <text class="result-value"
                              :class="{
                                 'value-pass': item.fcheckResu === '合格',
                                 'value-fail': item.fcheckResu === '不合格'
                              }"
                        class="result-value">
                              }">
                    {{ item.fcheckResu }}
                  </text>
                </view>
@@ -252,7 +264,7 @@
            <!-- 操作指示器 -->
            <view class="action-indicator">
              <uni-icons color="#94a3b8" size="16" type="arrowright"></uni-icons>
                     <uni-icons type="arrowright" size="16" color="#94a3b8"></uni-icons>
            </view>
          </view>
        </view>
@@ -262,7 +274,7 @@
    <!-- 浮动操作按钮 -->
    <view class="fab-container">
      <view class="fab-button" @tap="handleFabClick">
        <uni-icons color="#ffffff" size="24" type="plus"></uni-icons>
            <uni-icons type="plus" size="24" color="#ffffff"></uni-icons>
      </view>
    </view>
  </view>
@@ -283,11 +295,12 @@
      noData: false,
      isLoading: false,
      tipShow: false,
      searchOptions: ['物料编码', '物料名称', '创建人员', '检验单号'],
            searchOptions: ['物料编号', '规格', '物料名称', '供应商', '送检人', '检验单号'],
      selectedOption: 0,
      searchValue: '',
      copiedText: '',
      headerHeight: 0
            headerHeight: 0,
            showFilter: false, // 控制筛选面板显示
    };
  },
  onLoad() {
@@ -333,20 +346,25 @@
      if (this.searchValue != null && this.searchValue.trim() !== '') {
        // 根据选择的搜索选项设置搜索条件
        switch (this.selectedOption) {
          case 0: // 物料编码
            requestData.itemNo = this.searchValue;
                  case 0:
                     requestData.ItemNo = this.searchValue;
            break;
          case 1: // 物料名称
            requestData.itemName = this.searchValue;
                  case 1:
                     requestData.SalesOrder = this.searchValue;
            break;
          case 2: // 创建人员
            requestData.createUser = this.searchValue;
                  case 2:
                     requestData.ItemName = this.searchValue;
            break;
          case 3: // 检验单号
            requestData.releaseNo = this.searchValue;
                  case 3:
                     requestData.SuppNameContains = this.searchValue;
                     break;
                  case 4:
                     requestData.SongJ = this.searchValue;
                     break;
                  case 5:
                     requestData.SongNo = this.searchValue;
            break;
        }
        requestData.searchIndex = this.selectedOption;
      }
      this.$post({
@@ -439,6 +457,14 @@
        url: 'Add?id=' + item.id
      });
    },
         toggleFilter() {
            this.showFilter = !this.showFilter;
         },
         clearSearch() {
            this.searchValue = '';
            this.pageIndex = 1;
            this.loadData();
         }
  },
  onPullDownRefresh() {
    this.pageIndex = 1;
@@ -559,71 +585,95 @@
  margin-top: 2px;
}
/* 搜索栏样式 */
.search-bar {
/* 搜索区域 */
.search-section {
  margin-bottom: 16px;
}
.search-card {
.search-container {
  display: flex;
  gap: 8px;
  align-items: center;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  height: 44px;
}
.picker {
  width: 120px;
  height: 44px;
  line-height: 44px;
  text-align: center;
  font-size: 14px;
  color: #666;
  border-right: 1px solid #e0e0e0;
  white-space: nowrap;
.search-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0 12px;
}
.search-input-wrapper:focus-within {
  border-color: #007AFF;
  background: white;
}
.search-input {
  flex: 1;
  height: 44px;
  line-height: 44px;
  height: 40px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: #333;
  padding: 0 12px;
  border: none;
  margin-left: 8px;
  outline: none;
  background: transparent;
}
.search-input::placeholder {
  color: #999;
}
.search-btn {
  background: linear-gradient(135deg, #007AFF, #0056D6);
  color: white;
  text-align: center;
  font-size: 14px;
  width: 80px;
  height: 44px;
  line-height: 44px;
  border-radius: 0 12px 12px 0;
  border: none;
.clear-btn {
  padding: 4px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.2);
}
.search-btn:hover {
  background: linear-gradient(135deg, #0056D6, #004BB8);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 122, 255, 0.25);
.filter-btn {
  width: 40px;
  height: 40px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.15);
.filter-btn:active {
  background: #e0e0e0;
}
/* 筛选面板 */
.filter-panel {
  margin-top: 8px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
}
.filter-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  cursor: pointer;
}
.filter-label {
  font-size: 14px;
  color: #666;
}
.filter-value {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}
/* 选项卡 */
@@ -689,12 +739,8 @@
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.loading-text {