|
|
@ -17,9 +17,10 @@ |
|
|
</header> |
|
|
</header> |
|
|
|
|
|
|
|
|
<section class="board-summary"> |
|
|
<section class="board-summary"> |
|
|
<!-- 顶部只保留总数/未完成/已完成,异常行不单独占位,让表体多显示 - rqrq --> |
|
|
|
|
|
|
|
|
<!-- 盘点核对单独计数并排在未完成前。数据异常仍不占顶部,避免汇总行挤占表体 - rqrq --> |
|
|
<div class="summary-counts"> |
|
|
<div class="summary-counts"> |
|
|
<span>标签 <strong>{{ visibleRows.length }}</strong></span> |
|
|
<span>标签 <strong>{{ visibleRows.length }}</strong></span> |
|
|
|
|
|
<span>盘点核对 <strong class="verify-text">{{ verifyCount }}</strong></span> |
|
|
<span>未完成 <strong class="pending-text">{{ pendingCount }}</strong></span> |
|
|
<span>未完成 <strong class="pending-text">{{ pendingCount }}</strong></span> |
|
|
<span>已完成 <strong class="completed-text">{{ completedCount }}</strong></span> |
|
|
<span>已完成 <strong class="completed-text">{{ completedCount }}</strong></span> |
|
|
</div> |
|
|
</div> |
|
|
@ -55,7 +56,7 @@ |
|
|
<td class="barcode" :title="item.rfidBarcode">{{ item.rfidBarcode }}</td> |
|
|
<td class="barcode" :title="item.rfidBarcode">{{ item.rfidBarcode }}</td> |
|
|
<!-- 数量是标签handling_unit.qty,去尾零;查不到或重码时后端为空,页面显示横线 - rqrq --> |
|
|
<!-- 数量是标签handling_unit.qty,去尾零;查不到或重码时后端为空,页面显示横线 - rqrq --> |
|
|
<td>{{ formatQty(item.qty) }}</td> |
|
|
<td>{{ formatQty(item.qty) }}</td> |
|
|
<td><span :class="['status-badge', item.status === '已完成' ? 'completed' : item.status === '数据异常' ? 'abnormal' : 'pending']">{{ item.status }}</span></td> |
|
|
|
|
|
|
|
|
<td><span :class="['status-badge', statusClass(item.status)]">{{ item.status }}</span></td> |
|
|
</tr> |
|
|
</tr> |
|
|
<!-- 未返回任务时表体留白,不展示空数据或异常提示;连接状态由标题指示灯表示 - rqrq --> |
|
|
<!-- 未返回任务时表体留白,不展示空数据或异常提示;连接状态由标题指示灯表示 - rqrq --> |
|
|
</tbody> |
|
|
</tbody> |
|
|
@ -108,6 +109,7 @@ export default { |
|
|
updatedTime () { return this.updatedAt ? dayjs(this.updatedAt).format('YYYY-MM-DD HH:mm:ss') : '-' }, |
|
|
updatedTime () { return this.updatedAt ? dayjs(this.updatedAt).format('YYYY-MM-DD HH:mm:ss') : '-' }, |
|
|
stale () { return this.lastReceivedAt > 0 && this.now - this.lastReceivedAt > 20000 }, |
|
|
stale () { return this.lastReceivedAt > 0 && this.now - this.lastReceivedAt > 20000 }, |
|
|
visibleRows () { return this.available && !this.stale ? this.rows : [] }, |
|
|
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 }, |
|
|
pendingCount () { return this.visibleRows.filter(item => item.status === '未完成').length }, |
|
|
// 数据异常独立计数,避免隐藏说明列后总数与未完成、已完成之和不一致却没有提示 - rqrq |
|
|
// 数据异常独立计数,避免隐藏说明列后总数与未完成、已完成之和不一致却没有提示 - rqrq |
|
|
abnormalCount () { return this.visibleRows.filter(item => item.status === '数据异常').length }, |
|
|
abnormalCount () { return this.visibleRows.filter(item => item.status === '数据异常').length }, |
|
|
@ -264,24 +266,26 @@ export default { |
|
|
const board = data.row |
|
|
const board = data.row |
|
|
this.lastReceivedAt = Date.now() |
|
|
this.lastReceivedAt = Date.now() |
|
|
this.available = board.available === true |
|
|
this.available = board.available === true |
|
|
// 四个人工位置的HTTP与推送数据统一按未完成、数据异常、已完成稳定分组,组内保留原顺序 - rqrq |
|
|
|
|
|
|
|
|
// 人工四屏按盘点核对、未完成、数据异常、已完成分组,组内保留原顺序 - rqrq |
|
|
const sourceRows = this.available && Array.isArray(board.rows) ? board.rows : [] |
|
|
const sourceRows = this.available && Array.isArray(board.rows) ? board.rows : [] |
|
|
|
|
|
const verifyRows = [] |
|
|
const unfinishedRows = [] |
|
|
const unfinishedRows = [] |
|
|
const abnormalRows = [] |
|
|
const abnormalRows = [] |
|
|
const completedRows = [] |
|
|
const completedRows = [] |
|
|
sourceRows.forEach(item => { |
|
|
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 if (item.status === '未完成') unfinishedRows.push(item) |
|
|
else abnormalRows.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 orderChanged = this.rows.length !== nextRows.length || this.rows.some((item, index) => { |
|
|
const nextItem = nextRows[index] |
|
|
const nextItem = nextRows[index] |
|
|
return item.rfidBarcode !== nextItem.rfidBarcode || item.status !== nextItem.status |
|
|
return item.rfidBarcode !== nextItem.rfidBarcode || item.status !== nextItem.status |
|
|
}) |
|
|
}) |
|
|
this.rows = nextRows |
|
|
this.rows = nextRows |
|
|
// 列表顺序或状态变化且仍有待处理/异常项时回到顶部,避免旧滚动位置让已完成项遮住它们 - rqrq |
|
|
// 列表顺序或状态变化且仍有待处理/异常项时回到顶部,避免旧滚动位置让已完成项遮住它们 - rqrq |
|
|
if (orderChanged && (unfinishedRows.length > 0 || abnormalRows.length > 0)) { |
|
|
|
|
|
|
|
|
if (orderChanged && (verifyRows.length > 0 || unfinishedRows.length > 0 || abnormalRows.length > 0)) { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
if (this.$refs.tableViewport) this.$refs.tableViewport.scrollTop = 0 |
|
|
if (this.$refs.tableViewport) this.$refs.tableViewport.scrollTop = 0 |
|
|
}) |
|
|
}) |
|
|
@ -320,6 +324,13 @@ export default { |
|
|
if (version === this.requestVersion) this.queryLoading = false |
|
|
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 |
|
|
// 无论首次数据何时到达都按实际滚动高度启动;底部停留2秒后回到顶部,少量数据不滚动 - rqrq |
|
|
scrollTable () { |
|
|
scrollTable () { |
|
|
const viewport = this.$refs.tableViewport |
|
|
const viewport = this.$refs.tableViewport |
|
|
@ -355,6 +366,7 @@ export default { |
|
|
.summary-counts span { font-size: 20px; } |
|
|
.summary-counts span { font-size: 20px; } |
|
|
/* 数字和文字同号,不再放大,避免把汇总行重新撑高 - rqrq */ |
|
|
/* 数字和文字同号,不再放大,避免把汇总行重新撑高 - rqrq */ |
|
|
.summary-counts strong { font-size: 20px; margin-left: 8px; } |
|
|
.summary-counts strong { font-size: 20px; margin-left: 8px; } |
|
|
|
|
|
.verify-text { color: #9fd0ff; } |
|
|
.pending-text { color: #ffd17d; } |
|
|
.pending-text { color: #ffd17d; } |
|
|
.completed-text { color: #80e5bc; } |
|
|
.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; } |
|
|
.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; } |
|
|
.board-table .row-message { color: #ffd17d; font-size: 16px; } |
|
|
/* 状态字号加2px,行盒保持原高度,避免状态块把表格行撑高 - rqrq */ |
|
|
/* 状态字号加2px,行盒保持原高度,避免状态块把表格行撑高 - rqrq */ |
|
|
.status-badge { display: inline-block; padding: 5px 10px; border-radius: 4px; white-space: nowrap; font-size: 18px; line-height: 19px; } |
|
|
.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.pending { background: #745827; color: #fff0cf; } |
|
|
.status-badge.abnormal { background: #8b2d2d; color: #ffe2e2; } |
|
|
.status-badge.abnormal { background: #8b2d2d; color: #ffe2e2; } |
|
|
.status-badge.completed { background: #21684e; color: #d4ffeb; } |
|
|
.status-badge.completed { background: #21684e; color: #d4ffeb; } |
|
|
|