|
@@ -844,9 +844,17 @@ export default {
|
|
|
const dataContent = [flightNO, flightDate, bagSN]
|
|
|
try {
|
|
|
const result = await this.queryBaggageMessage(dataContent)
|
|
|
- const messageList = result.map(message => {
|
|
|
- return typeof message === 'string' ? JSON.parse(message) : message
|
|
|
- })
|
|
|
+ // const messageList = result.map(message => {
|
|
|
+ // return typeof message === 'string' ? JSON.parse(message) : message
|
|
|
+ // })
|
|
|
+ const messageList = result.reduce((list, message) => {
|
|
|
+ const messageObject = typeof message === 'string' ? JSON.parse(message) : message
|
|
|
+ if (messageObject.dataContent.includes(bagSN.slice(0, 7))) {
|
|
|
+ return [...list, messageObject]
|
|
|
+ } else {
|
|
|
+ return list
|
|
|
+ }
|
|
|
+ }, [])
|
|
|
this.messageList = this._.sortBy(messageList, 'ssid')
|
|
|
} catch (error) {
|
|
|
console.log('出错了', error.message || error)
|