Jelajahi Sumber

行李报文过滤

zhongxiaoyu 2 tahun lalu
induk
melakukan
feff765644
1 mengubah file dengan 11 tambahan dan 3 penghapusan
  1. 11 3
      src/views/baggageManagement/components/baggage/index.vue

+ 11 - 3
src/views/baggageManagement/components/baggage/index.vue

@@ -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)