| | |
| | | <view class="inspection-app"> |
| | | <!-- 顶部筛选区 --> |
| | | <view class="filter-section"> |
| | | <view class="filter-controls"> |
| | | <view class="dropdown-filter"> |
| | | <picker @change="onProjectChange" :value="projectIndex" :range="projects"> |
| | | <view class="picker">{{projects[projectIndex]}}</view> |
| | | </picker> |
| | | |
| | | <view class="filter-controls" style="margin-bottom: 5px;"> |
| | | <view class="status-tabs"> |
| | | <button :class="['tab-button', activeTab === 0 ? 'active' : '']" |
| | | @click="switchTab(0)">未检验({{uncheckedCount}})</button> |
| | | <button :class="['tab-button', activeTab === 1 ? 'active' : '']" |
| | | @click="switchTab(1)">{{checkedCount}}</button> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="filter-controls" style="margin-bottom: 5px;"> |
| | | <view class="status-tabs" style="margin-right: 10px;"> |
| | | <button :class="['tab-button', arrivalFilter === -1 ? 'active' : '']" |
| | | @click="switchArrivalFilter(-1)">全部</button> |
| | | <button :class="['tab-button', arrivalFilter === 1 ? 'active' : '']" |
| | | @click="switchArrivalFilter(1)">已到达</button> |
| | | <button :class="['tab-button', arrivalFilter === 0 ? 'active' : '']" |
| | | @click="switchArrivalFilter(0)">未到达</button> |
| | | </view> |
| | | |
| | | <view class="dropdown-filter"> |
| | | <picker @change="onProjectChange" :value="projectIndex" :range="projects"> |
| | | <view class="picker">{{projects[projectIndex]}}</view> |
| | | </picker> |
| | | |
| | | </view> |
| | | <view class="dropdown-filter"> |
| | | <picker @change="onOptionsChange" :value="optionsIndex" :range="options"> |
| | | <view class="picker">{{options[optionsIndex]}}</view> |
| | |
| | | <button class="search-button" @click="handleSearch">搜索</button> |
| | | </view> |
| | | |
| | | <view class="status-tabs"> |
| | | <button :class="['tab-button', activeTab === 0 ? 'active' : '']" |
| | | @click="switchTab(0)">未检验({{uncheckedCount}})</button> |
| | | <button :class="['tab-button', activeTab === 1 ? 'active' : '']" |
| | | @click="switchTab(1)">{{checkedCount}}</button> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | | <view class="filter-controls" style="margin-bottom: 5px;"> |
| | | |
| | | |
| | | <view class="dropdown-filter" v-if="activeTab==1"> |
| | | <picker @change="onStateChange" :value="stateIndex" :range="state"> |
| | | <view class="picker">{{state[stateIndex]}}</view> |
| | | </picker> |
| | | |
| | | </view> |
| | | <view class="dropdown-filter" v-if="activeTab==1"> |
| | | <picker mode="date" :value="startDate" :end="endDate" @change="bindStartDate"> |
| | | <view class="picker">{{startDate}}</view> |
| | | </picker> |
| | | |
| | | </view> |
| | | <view class="dropdown-filter" v-if="activeTab==1"> |
| | | <picker mode="date" :value="endDate" :start="startDate" @change="bindEndDate"> |
| | | <view class="picker">{{endDate}}</view> |
| | | </picker> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <!-- 检验单列表 --> |
| | |
| | | <text class="badge normal" v-if="item.ftype == 1">委外</text> |
| | | <text class="badge normal" v-if="item.first == 1">首次来料</text> |
| | | <text class="card-title">检验单号: {{item.releaseNo}}</text> |
| | | <text class="status arrived" v-if="item.isArrival == 1">已到达</text> |
| | | <text class="status not-arrived" v-if="item.isArrival == 0">未到达</text> |
| | | <text class="status pending" v-if="item.userName==null && item.activeTab==0">待分配</text> |
| | | <text class="status assigned" v-if="item.userName!=null && item.activeTab==0">已分配</text> |
| | | <text class="status pass" v-if="item.fcheckResu=='合格' && item.activeTab==1">合格</text> |
| | |
| | | <text class="info-label">数量</text> |
| | | <text class="info-content highlight">{{item.fcovertQty}}</text> |
| | | </view> |
| | | <view class="info-item"> |
| | | <text class="info-label">抽检</text> |
| | | <text class="info-content highlight">{{item.maxCheckQyt}}</text> |
| | | </view> |
| | | </view> |
| | | <view class="info-row"> |
| | | <view class="info-item"> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="meta-info"> |
| | | <view class="meta-info" v-if="item.activeTab==0"> |
| | | <text class="meta-item"><uni-icons type="calendar" size="14" color="#95a5a6"></uni-icons> |
| | | {{item.createDate}}</text> |
| | | <text class="meta-item"><uni-icons type="person" size="14" color="#95a5a6"></uni-icons> |
| | | {{item.userName}}</text> |
| | | </view> |
| | | <!-- 查看时显示检验完成的数据 --> |
| | | <view class="meta-info" v-if="item.activeTab==1"> |
| | | <text class="meta-item"><uni-icons type="calendar" size="14" color="#95a5a6"></uni-icons> |
| | | {{item.date01}}</text> |
| | | <text class="meta-item"><uni-icons type="person" size="14" color="#95a5a6"></uni-icons> |
| | | {{item.fcheckBy}}</text> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | return { |
| | | projectIndex: 0, |
| | | optionsIndex: 0, |
| | | stateIndex: 0, |
| | | projects: ['当前', '全部'], |
| | | state:['所有状态','合格','不合格'], |
| | | activeTab: 0, // 0-未检验, 1-已检验 |
| | | uncheckedCount: 0, |
| | | checkedCount: '已检验', |
| | |
| | | limit: 20, |
| | | IQCJL: 0, |
| | | options: ['项目', '物料编号', '物料名称', '供应商', '采购员'], |
| | | searchValue: '' |
| | | |
| | | searchValue: '', |
| | | startDate:new Date().toISOString().slice(0, 10), |
| | | endDate:new Date().toISOString().slice(0, 10), |
| | | arrivalFilter: -1, |
| | | } |
| | | }, |
| | | onLoad() { |
| | | //页面加载时调用的事件 |
| | | this.init(); |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | //搜索 |
| | |
| | | }; |
| | | this.selectedField = fieldMap[this.optionsIndex]; |
| | | }, |
| | | onStateChange(e) { |
| | | this.pageIndex=1; |
| | | this.stateIndex = e.detail.value; |
| | | this.init(); |
| | | }, |
| | | //搜索按钮点击事件 |
| | | handleSearch() { |
| | | this.pageIndex=1; |
| | | this.init(); |
| | | }, |
| | | init() { |
| | |
| | | result: result, |
| | | SearchValue: this.searchValue, |
| | | selectedIndex: this.optionsIndex, //下拉框筛选条件 |
| | | userIndex: this.projectIndex |
| | | userIndex: this.projectIndex, |
| | | startDate:this.startDate, |
| | | endDate:this.endDate, |
| | | state:this.state[this.stateIndex], |
| | | arrivalFilter: this.arrivalFilter |
| | | } |
| | | }).then(res => { |
| | | if (this.pageIndex === 1) { |
| | |
| | | } |
| | | |
| | | } |
| | | console.log(this.inspectionList) |
| | | //console.log(this.inspectionList) |
| | | this.totalCount = res.data.totalCount; |
| | | this.totalPage = Math.ceil(this.totalCount / this.limit); |
| | | |
| | |
| | | // icon: 'none' |
| | | // }) |
| | | |
| | | }, |
| | | bindEndDate(e){ |
| | | this.endDate=e.detail.value |
| | | console.log(e.detail.value) |
| | | }, |
| | | bindStartDate(e){ |
| | | this.startDate=e.detail.value |
| | | }, |
| | | switchTab(index) { |
| | | this.activeTab = index |
| | |
| | | } |
| | | await this.init(); // 自定义的刷新函数 |
| | | |
| | | }, |
| | | switchArrivalFilter(filter) { |
| | | this.arrivalFilter = filter; |
| | | this.pageIndex = 1; |
| | | this.inspectionList = []; |
| | | this.init(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | /* 顶部筛选区 */ |
| | | .filter-section { |
| | | margin-bottom: 24px; |
| | | /* margin-bottom: 24px; */ |
| | | } |
| | | |
| | | .filter-section h1 { |
| | |
| | | .filter-controls { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 10px; |
| | | gap: 5px; |
| | | } |
| | | |
| | | .dropdown-filter { |
| | |
| | | padding: 4px 8px; |
| | | border-radius: 4px; |
| | | font-weight: 500; |
| | | margin-left: 8px; |
| | | } |
| | | |
| | | .status.pending { |
| | |
| | | color: white; |
| | | } |
| | | |
| | | .status.arrived { |
| | | background-color: #00cd00; |
| | | color: white; |
| | | } |
| | | |
| | | .status.not-arrived { |
| | | background-color: #95a5a6; |
| | | color: white; |
| | | } |
| | | |
| | | .status.pass { |
| | | background-color: #00cd00; |
| | | color: white; |