Browse Source

排序

master
han\hanst 3 months ago
parent
commit
c913415226
  1. 21
      src/views/modules/dashboard/robot-picking-board.vue

21
src/views/modules/dashboard/robot-picking-board.vue

@ -283,9 +283,10 @@ export default {
*/ */
handleWebSocketMessage(message) { handleWebSocketMessage(message) {
if (message && message.code === 0) { 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 => { this.containerPickingList.forEach(item => {
if (item.storageBatchNo && item.storageBatchNo.length < 10) { if (item.storageBatchNo && item.storageBatchNo.length < 10) {
item.status = '分拣中' 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
})
} }
}, },

Loading…
Cancel
Save