diff --git a/src/views/modules/dashboard/robot-picking-board.vue b/src/views/modules/dashboard/robot-picking-board.vue index e7fe70d..647c3b7 100644 --- a/src/views/modules/dashboard/robot-picking-board.vue +++ b/src/views/modules/dashboard/robot-picking-board.vue @@ -283,9 +283,10 @@ export default { */ handleWebSocketMessage(message) { if (message && message.code === 0) { - this.containerPickingList = message.data.containerList - this.materialPickingList = message.data.materialList - // 如果storageBatchNo.length>10,则status改成分拣中 + this.containerPickingList = message.data.containerList || [] + this.materialPickingList = message.data.materialList || [] + + // 如果 storageBatchNo.length < 10,则 status 改成 分拣中 this.containerPickingList.forEach(item => { if (item.storageBatchNo && item.storageBatchNo.length < 10) { item.status = '分拣中' @@ -298,6 +299,20 @@ export default { } }) + // 排序:分拣中 在最上面 + this.containerPickingList.sort((a, b) => { + if (a.status === '分拣中' && b.status !== '分拣中') return -1 + if (a.status !== '分拣中' && b.status === '分拣中') return 1 + return 0 + }) + + this.materialPickingList.sort((a, b) => { + if (a.status === '分拣中' && b.status !== '分拣中') return -1 + if (a.status !== '分拣中' && b.status === '分拣中') return 1 + return 0 + }) + + } },