diff --git a/src/views/modules/haianWarehouse/dashboard/sortingBoard54.vue b/src/views/modules/haianWarehouse/dashboard/sortingBoard54.vue index 354b400..21fdfc6 100644 --- a/src/views/modules/haianWarehouse/dashboard/sortingBoard54.vue +++ b/src/views/modules/haianWarehouse/dashboard/sortingBoard54.vue @@ -17,9 +17,10 @@
- +
标签 {{ visibleRows.length }} + 盘点核对 {{ verifyCount }} 未完成 {{ pendingCount }} 已完成 {{ completedCount }}
@@ -55,7 +56,7 @@ {{ item.rfidBarcode }} {{ formatQty(item.qty) }} - {{ item.status }} + {{ item.status }} @@ -108,6 +109,7 @@ export default { updatedTime () { return this.updatedAt ? dayjs(this.updatedAt).format('YYYY-MM-DD HH:mm:ss') : '-' }, stale () { return this.lastReceivedAt > 0 && this.now - this.lastReceivedAt > 20000 }, visibleRows () { return this.available && !this.stale ? this.rows : [] }, + verifyCount () { return this.visibleRows.filter(item => item.status === '盘点核对').length }, pendingCount () { return this.visibleRows.filter(item => item.status === '未完成').length }, // 数据异常独立计数,避免隐藏说明列后总数与未完成、已完成之和不一致却没有提示 - rqrq abnormalCount () { return this.visibleRows.filter(item => item.status === '数据异常').length }, @@ -264,24 +266,26 @@ export default { const board = data.row this.lastReceivedAt = Date.now() this.available = board.available === true - // 四个人工位置的HTTP与推送数据统一按未完成、数据异常、已完成稳定分组,组内保留原顺序 - rqrq + // 人工四屏按盘点核对、未完成、数据异常、已完成分组,组内保留原顺序 - rqrq const sourceRows = this.available && Array.isArray(board.rows) ? board.rows : [] + const verifyRows = [] const unfinishedRows = [] const abnormalRows = [] const completedRows = [] sourceRows.forEach(item => { - if (item.status === '已完成') completedRows.push(item) + if (item.status === '盘点核对') verifyRows.push(item) + else if (item.status === '已完成') completedRows.push(item) else if (item.status === '未完成') unfinishedRows.push(item) else abnormalRows.push(item) }) - const nextRows = unfinishedRows.concat(abnormalRows, completedRows) + const nextRows = verifyRows.concat(unfinishedRows, abnormalRows, completedRows) const orderChanged = this.rows.length !== nextRows.length || this.rows.some((item, index) => { const nextItem = nextRows[index] return item.rfidBarcode !== nextItem.rfidBarcode || item.status !== nextItem.status }) this.rows = nextRows // 列表顺序或状态变化且仍有待处理/异常项时回到顶部,避免旧滚动位置让已完成项遮住它们 - rqrq - if (orderChanged && (unfinishedRows.length > 0 || abnormalRows.length > 0)) { + if (orderChanged && (verifyRows.length > 0 || unfinishedRows.length > 0 || abnormalRows.length > 0)) { this.$nextTick(() => { if (this.$refs.tableViewport) this.$refs.tableViewport.scrollTop = 0 }) @@ -320,6 +324,13 @@ export default { if (version === this.requestVersion) this.queryLoading = false } }, + // 盘点核对用独立颜色,避免被未完成或数据异常的样式盖住 - rqrq + statusClass (status) { + if (status === '盘点核对') return 'verify' + if (status === '已完成') return 'completed' + if (status === '数据异常') return 'abnormal' + return 'pending' + }, // 无论首次数据何时到达都按实际滚动高度启动;底部停留2秒后回到顶部,少量数据不滚动 - rqrq scrollTable () { const viewport = this.$refs.tableViewport @@ -355,6 +366,7 @@ export default { .summary-counts span { font-size: 20px; } /* 数字和文字同号,不再放大,避免把汇总行重新撑高 - rqrq */ .summary-counts strong { font-size: 20px; margin-left: 8px; } +.verify-text { color: #9fd0ff; } .pending-text { color: #ffd17d; } .completed-text { color: #80e5bc; } .ws-status-dot { display: inline-block; width: 12px; height: 12px; margin-left: 12px; border-radius: 50%; vertical-align: middle; background: #94a3b8; } @@ -374,6 +386,7 @@ export default { .board-table .row-message { color: #ffd17d; font-size: 16px; } /* 状态字号加2px,行盒保持原高度,避免状态块把表格行撑高 - rqrq */ .status-badge { display: inline-block; padding: 5px 10px; border-radius: 4px; white-space: nowrap; font-size: 18px; line-height: 19px; } +.status-badge.verify { background: #1d4e89; color: #e7f3ff; } .status-badge.pending { background: #745827; color: #fff0cf; } .status-badge.abnormal { background: #8b2d2d; color: #ffe2e2; } .status-badge.completed { background: #21684e; color: #d4ffeb; }