浏览代码

行李报文修改

zhaoke 1 年之前
父节点
当前提交
002a986558
共有 1 个文件被更改,包括 14 次插入4 次删除
  1. 14 4
      src/views/newBagDetails/components/baggageMessage.vue

+ 14 - 4
src/views/newBagDetails/components/baggageMessage.vue

@@ -74,10 +74,20 @@ export default {
         const { code, returnData } = await this.getQueryList(SERVICE_ID.bagDetailId, this.dataContent)
         if (code == 0 && returnData && returnData.length) {
           // this.messageList = [...returnData]
-          this.messageList = returnData.map(message => ({
-            ...message,
-            readTime: message.readTime ? `${message.readTime.replace('T', ' ')}(广州)` : '(北京)'
-          }))
+          const messageDatas = [...returnData]
+          messageDatas.map(item => {
+            const { dataObjectId } = item
+            const len = dataObjectId.length
+            const popNums = [206, 207, 208, 209, 210, 211, 212, 213].map(item => item.toString())
+            const target = dataObjectId.substr(len - 3, len)
+            const place = popNums.includes(target) ? '(广州)' : '(国航)'
+            item.readTime = item.readTime.replace('T', ' ') + place
+          })
+          this.messageList = messageDatas
+          // this.messageList = returnData.map(message => ({
+          //   ...message,
+          //   readTime: message.readTime ? `${message.readTime.replace('T', ' ')}(广州)` : '(北京)'
+          // }))
           this.loading = false
         } else {
           this.loading = false