From 4dc0880780b52c0c35456666a4643a7866b454a7 Mon Sep 17 00:00:00 2001
From: fcx <2246384483@qq.com>
Date: 星期六, 20 十二月 2025 16:00:35 +0800
Subject: [PATCH] 1.产检提交增加日期选择器
---
pages/QC/SJ/ProductionLineSubmit.vue | 95 +++++++++++++++++++++++------------------------
1 files changed, 47 insertions(+), 48 deletions(-)
diff --git a/pages/QC/SJ/ProductionLineSubmit.vue b/pages/QC/SJ/ProductionLineSubmit.vue
index 06cd0cb..8c5b300 100644
--- a/pages/QC/SJ/ProductionLineSubmit.vue
+++ b/pages/QC/SJ/ProductionLineSubmit.vue
@@ -31,19 +31,19 @@
</view>
</view>
- <!-- 娣诲姞鐘舵�佺瓫閫夊拰鏃ユ湡閫夋嫨鍣紙浠呭湪宸叉彁浜ら〉闈㈡樉绀猴級 -->
+ <!-- 娣诲姞鐘舵�佺瓫閫夊拰鏃ユ湡閫夋嫨鍣紙鏈彁浜ゅ拰宸叉彁浜ら〉闈㈤兘鏄剧ず锛� -->
<view class="filter-controls" style="margin-bottom: 5px;">
- <view class="dropdown-filter" v-if="currentTab === 1">
+ <view class="dropdown-filter">
<picker @change="onStateChange" :value="stateIndex" :range="state">
<view class="picker">{{state[stateIndex]}}</view>
</picker>
</view>
- <view class="dropdown-filter" v-if="currentTab === 1">
+ <view class="dropdown-filter">
<picker mode="date" :value="startDate" :end="endDate" @change="bindStartDate">
<view class="picker">{{startDate}}</view>
</picker>
</view>
- <view class="dropdown-filter" v-if="currentTab === 1">
+ <view class="dropdown-filter">
<picker mode="date" :value="endDate" :start="startDate" @change="bindEndDate">
<view class="picker">{{endDate}}</view>
</picker>
@@ -276,53 +276,52 @@
list = [...failedItems, ...otherItems];
}
- // 濡傛灉鏄凡鎻愪氦椤甸潰锛岃繘琛屽墠绔瓫閫�
- if (this.currentTab === 1) {
- // 鐘舵�佺瓫閫�
- if (this.stateIndex > 0) {
- const selectedState = this.state[this.stateIndex];
- console.log("鍓嶇鐘舵�佺瓫閫�:", selectedState);
- if (selectedState === '鍚堟牸') {
- list = list.filter(item => item.result === '鍚堟牸');
- } else if (selectedState === '涓嶅悎鏍�') {
- list = list.filter(item => item.result === '涓嶅悎鏍�');
- }
+ // 瀵规墍鏈夐〉闈㈣繘琛屽墠绔瓫閫夛紙鏈彁浜ゅ拰宸叉彁浜わ級
+ // 鐘舵�佺瓫閫�
+ if (this.stateIndex > 0) {
+ const selectedState = this.state[this.stateIndex];
+ console.log("鍓嶇鐘舵�佺瓫閫�:", selectedState);
+ if (selectedState === '鍚堟牸') {
+ list = list.filter(item => item.result === '鍚堟牸');
+ } else if (selectedState === '涓嶅悎鏍�') {
+ list = list.filter(item => item.result === '涓嶅悎鏍�');
+ }
+ }
+
+ // 鏃ユ湡鑼冨洿绛涢��
+ if (this.startDate || this.endDate) {
+ console.log("鍓嶇鏃ユ湡绛涢��:", this.startDate, "鍒�", this.endDate);
+ const startDateObj = this.startDate ? new Date(this.startDate) : null;
+ const endDateObj = this.endDate ? new Date(this.endDate) : null;
+
+ // 璁剧疆寮�濮嬫棩鏈熺殑鏃堕棿涓哄綋澶╃殑寮�濮嬫椂闂� (00:00:00)
+ if (startDateObj) {
+ startDateObj.setHours(0, 0, 0, 0);
}
- // 鏃ユ湡鑼冨洿绛涢��
- if (this.startDate || this.endDate) {
- console.log("鍓嶇鏃ユ湡绛涢��:", this.startDate, "鍒�", this.endDate);
- const startDateObj = this.startDate ? new Date(this.startDate) : null;
- const endDateObj = this.endDate ? new Date(this.endDate) : null;
-
- // 璁剧疆寮�濮嬫棩鏈熺殑鏃堕棿涓哄綋澶╃殑寮�濮嬫椂闂� (00:00:00)
- if (startDateObj) {
- startDateObj.setHours(0, 0, 0, 0);
- }
-
- // 璁剧疆缁撴潫鏃ユ湡鐨勬椂闂翠负褰撳ぉ鐨勭粨鏉熸椂闂� (23:59:59)
- if (endDateObj) {
- endDateObj.setHours(23, 59, 59, 999);
- }
-
- list = list.filter(item => {
- if (item.createTime) {
- const itemDate = new Date(item.createTime);
- let isValid = true;
-
- if (startDateObj && itemDate < startDateObj) {
- isValid = false;
- }
-
- if (endDateObj && itemDate > endDateObj) {
- isValid = false;
- }
-
- return isValid;
+ // 璁剧疆缁撴潫鏃ユ湡鐨勬椂闂翠负褰撳ぉ鐨勭粨鏉熸椂闂� (23:59:59)
+ if (endDateObj) {
+ endDateObj.setHours(23, 59, 59, 999);
+ }
+
+ list = list.filter(item => {
+ if (item.createTime) {
+ const itemDate = new Date(item.createTime);
+ let isValid = true;
+
+ if (startDateObj && itemDate < startDateObj) {
+ isValid = false;
}
- return true;
- });
- } }
+
+ if (endDateObj && itemDate > endDateObj) {
+ isValid = false;
+ }
+
+ return isValid;
+ }
+ return true;
+ });
+ }
if (this.pageIndex === 1) {
this.data = list;
} else {
--
Gitblit v1.9.3