From dbfb045ad92072e880104e13fddb4dc7574499a1 Mon Sep 17 00:00:00 2001
From: fcx <2246384483@qq.com>
Date: 星期五, 19 十二月 2025 13:56:02 +0800
Subject: [PATCH] 1.给SJ获取检验项目添加防抖
---
pages/QC/SJ/List.vue | 56 +++++++++++++++++++++++++++++++++++++-------------------
1 files changed, 37 insertions(+), 19 deletions(-)
diff --git a/pages/QC/SJ/List.vue b/pages/QC/SJ/List.vue
index 2032d68..00e0167 100644
--- a/pages/QC/SJ/List.vue
+++ b/pages/QC/SJ/List.vue
@@ -11,15 +11,22 @@
@click="onClickItem({currentIndex: 0})">鏈畬鎴�({{ uncheckedCount }})
</button>
<button :class="['tab-button', current === 1 ? 'active' : '']"
- @click="onClickItem({currentIndex: 1})">{{ checkedCount }}
+ @click="onClickItem({currentIndex: 1})">宸叉彁浜�({{ checkedCount }})
</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 v-model="searchValue" class="search-input" placeholder="璇疯緭鍏ユ楠屽崟鍙锋垨鐗╂枡缂栫爜"
- @confirm="handleSearch"/>
+ <input class="search-input" v-model="searchValue" :placeholder="'璇疯緭鍏�'+options[optionsIndex]"
+ @confirm="handleSearch" />
<button class="search-button" @click="handleSearch">鎼滅储</button>
</view>
</view>
@@ -38,12 +45,12 @@
<view :class="{
'status-pending': !item.result && current === 0,
'status-assigned': current === 0 && item.statusUser && !item.result,
- 'status-pass': item.result === '鍚堟牸',
- 'status-fail': item.result === '涓嶅悎鏍�',
+ 'status-pass': item.result === '鍚堟牸'&& current === 1,
+ 'status-fail': item.result === '涓嶅悎鏍�'&& current === 1,
'status-submitted': !item.result && current === 1
}"
class="status">
- {{ current === 0 ? (item.result ? item.result : '鏈彁浜�') : (item.result ? item.result : '宸叉彁浜�') }}
+ {{ current === 0 ? ('' ? item.result : '鏈彁浜�') : (item.result ? item.result : '宸叉彁浜�') }}
</view>
</view>
@@ -142,9 +149,11 @@
tipShow: false,
searchValue: '',
uncheckedCount: 0,
- checkedCount: '宸插畬鎴�',
+ checkedCount: 0,
IQCJL: 0, // IQC 妫�楠屽憳鏍囪瘑
- userId:""
+ userId:"",
+ optionsIndex: 0, // 鏂板锛氫笅鎷夐�夐」绱㈠紩
+ options: ['椤圭洰', '绾夸綋', '宸ュ崟鍙�', '鐗╂枡鍙�', '鐗╂枡鍚�'] // 鏂板锛氭悳绱㈤�夐」
};
},
@@ -176,6 +185,18 @@
},
methods: {
+ // 鏂板锛氭悳绱㈤�夐」鏀瑰彉浜嬩欢
+ onOptionsChange(e) {
+ this.optionsIndex = e.detail.value;
+ },
+
+ // 鏂板锛氭悳绱㈡寜閽偣鍑讳簨浠�
+ handleSearch() {
+ this.pageIndex = 1;
+ this.data = [];
+ this.init();
+ },
+
async init() {
let result = this.current === 1 ? "宸插畬鎴�" : "鏈畬鎴�";
if (this.isLoading) return;
@@ -191,7 +212,8 @@
limit: this.limit,
statusUser: userName,
result: result,
- searchValue: this.searchValue
+ searchValue: this.searchValue,
+ selectedIndex: this.optionsIndex // 鏂板锛氫紶閫掓悳绱㈤�夐」绱㈠紩
}
});
@@ -207,7 +229,7 @@
this.noData = this.pageIndex >= this.totalPage;
if (this.current === 1) {
- this.checkedCount = '宸插畬鎴愶紙' + this.totalCount + '锛�';
+ this.checkedCount = this.totalCount;
} else {
this.uncheckedCount = this.totalCount;
}
@@ -219,19 +241,15 @@
}
},
- // 鎼滅储
- handleSearch() {
- this.pageIndex = 1;
- this.data = [];
- this.init();
- },
-
// Tab 鍒囨崲
onClickItem(index) {
if (this.current !== index.currentIndex) {
this.current = index.currentIndex;
this.data = [];
this.pageIndex = 1;
+ // 閲嶇疆绛涢�夋潯浠�
+ this.optionsIndex = 0;
+ this.searchValue = '';
this.init();
}
},
@@ -512,7 +530,7 @@
}
.status-fail {
- background: linear-gradient(135deg, #3498db, #2980b9);
+ background: linear-gradient(135deg, #ff0000, #ff0000);
color: white;
}
--
Gitblit v1.9.3