| | |
| | | </view> |
| | | <!-- 新增搜索框和按钮 --> |
| | | <view class="search-container"> |
| | | <input class="search-input" v-model="searchValue" :placeholder="'请输入'+options[optionsIndex]" |
| | | <input class="search-input" v-model="searchValue" :placeholder="optionsIndex === 0 ? '选择项目时显示全部数据' : '请输入'+options[optionsIndex]" |
| | | @confirm="handleSearch" /> |
| | | <button class="search-button" @click="handleSearch">搜索</button> |
| | | </view> |
| | |
| | | <text class="badge normal" v-if="item.first == 1">首次来料</text> |
| | | <text class="card-title">检验单号: {{item.releaseNo}}</text> |
| | | <view v-if="item.userName == null && item.activeTab == 0"> |
| | | <text class="status pending" :class="{ 'emergency-pending': item.lotNo1 === '紧急放行,请勿验退!' }"> |
| | | <text class="status pending" :class="{ |
| | | 'emergency-pending': item.lotNo1 === '紧急放行,请勿验退!', |
| | | 'unmaintained-not-emergency': isUnmaintainedAndNotEmergency(item) |
| | | }"> |
| | | {{ item.lotNo1 === '紧急放行,请勿验退!' ? '紧急放行/' + getStatusText(item) : getStatusText(item) }} |
| | | </text> |
| | | |
| | |
| | | <view class="info-row"> |
| | | <view class="info-item"> |
| | | <text class="info-label">项目</text> |
| | | <text class="info-content">{{item.projectCodes}}</text> |
| | | <text class="info-content">{{item.DEPARTMENTNAME}}</text> |
| | | </view> |
| | | <view class="info-item" v-if="item.extendNo1!=null"> |
| | | <text class="info-label">技改状态</text> |
| | |
| | | pageIndex: 1, |
| | | limit: 20, |
| | | IQCJL: 0, |
| | | options: ['项目', '物料编号', '物料名称', '供应商', '采购员','到货单号','检验单号','物料规格'], |
| | | options: ['项目', '物料编号', '物料名称', '供应商', '到货单号','检验单号','物料规格'], |
| | | searchValue: '' |
| | | |
| | | } |
| | |
| | | //搜索 |
| | | onOptionsChange(e) { |
| | | this.optionsIndex = e.detail.value; |
| | | // 当选择项目时,清空搜索值 |
| | | if (this.optionsIndex === 0) { |
| | | this.searchValue = ''; |
| | | } |
| | | // 根据选择的选项设置搜索字段 |
| | | const fieldMap = { |
| | | 0: 'projectCodes', // 项目 |
| | | 0: 'DEPARTMENTNAME', // 项目 |
| | | 1: 'itemNo', // 物料编号 |
| | | 2: 'itemName', // 物料名称 |
| | | 3: 'suppName', // 供应商 |
| | | 4: 'purchaser' ,// 采购员 |
| | | 5: 'lotNO' ,// 到货单号 |
| | | 6: 'releaseNO' ,// 检验单号 |
| | | 7: 'ItemModel',//物料规格 |
| | | 4: 'lotNo' ,// 到货单号 |
| | | 5: 'releaseNo' ,// 检验单号 |
| | | 6: 'itemModel',//物料规格 |
| | | }; |
| | | this.selectedField = fieldMap[this.optionsIndex]; |
| | | }, |
| | | //搜索按钮点击事件 |
| | | handleSearch() { |
| | | // 当选择项目时,清空搜索值 |
| | | if (this.optionsIndex === 0) { |
| | | this.searchValue = ''; |
| | | } |
| | | this.init(); |
| | | }, |
| | | init() { |
| | |
| | | } |
| | | // 如果有检验项目,显示"待检验" |
| | | return '待检验'; |
| | | }, |
| | | |
| | | // 判断是否为未维护且非紧急放行 |
| | | isUnmaintainedAndNotEmergency(item) { |
| | | // 检查是否为未维护(没有检验项目) |
| | | const isUnmaintained = !item.inspectionItemCount || item.inspectionItemCount === 0; |
| | | // 检查是否为非紧急放行 |
| | | const isNotEmergency = item.lotNo1 !== '紧急放行,请勿验退!'; |
| | | return isUnmaintained && isNotEmergency; |
| | | }, |
| | | |
| | | // 判断是否为待分配状态(物料没有维护检验员或者该物料未在V_LLJ_USER里) |
| | | isUnmaintainedItem(item) { |
| | | // 检查物料是否在V_LLJ_USER视图中(即是否有维护检验员) |
| | | // 如果item.fcode为null或undefined,说明该物料未在V_LLJ_USER视图中 |
| | | // 或者该物料没有维护检验员 |
| | | return !item.fcode || item.fcode === null || item.fcode === ''; |
| | | } |
| | | } |
| | | } |
| | |
| | | color: white; |
| | | } |
| | | |
| | | .badge.unmaintained { |
| | | background-color: #1e8449; |
| | | color: white; |
| | | } |
| | | |
| | | .badge.emergency { |
| | | background-color: #ff4d4f; |
| | | color: white; |
| | |
| | | background-color: #ff0000; /* 红色背景 */ |
| | | color: white; |
| | | } |
| | | |
| | | .status.unmaintained-not-emergency { |
| | | background-color: #9c27b0; /* 紫色背景 */ |
| | | color: white; |
| | | box-shadow: 0 0 8px rgba(156, 39, 176, 0.3); |
| | | } |
| | | } |
| | | </style> |