| | |
| | | </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> |
| | |
| | | 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 { |