Jelajahi Sumber

行李详情修改日期

zhaoke 1 tahun lalu
induk
melakukan
c3ba78b467
2 mengubah file dengan 34 tambahan dan 7 penghapusan
  1. 2 1
      public/config.js
  2. 32 6
      src/views/newBagDetails/components/baggageView.vue

+ 2 - 1
public/config.js

@@ -65,6 +65,7 @@ window.SERVICE_ID = {
   baggageAirlineNew: 18008, // 行李-航段
   baggageDetailsNew: 441, // 行李-详情列表
   baggageMessageNew: 3068, // 行李-原始报文
+  baggageTime: 20039, //行李-起飞降落日期
 
   /***-----容器视图------***/
   containerHistory: 18026,
@@ -150,7 +151,7 @@ window.SERVICE_ID = {
   airlineCompanyByAirline: 200302, // 航司行李相关统计-航线
   airlineCompanyByAirport: 200303, // 航司行李相关统计-航站
   airlineCompanyByTerminal: 200304, // 航司行李相关统计-航站楼
-  
+
   flightClassificationAll: 200310, // 航班分类统计-全部
   flightClassificationByAirline: 200311, // 航班分类统计-航线
   flightClassificationByAirport: 200312, // 航班分类统计-航站

+ 32 - 6
src/views/newBagDetails/components/baggageView.vue

@@ -9,7 +9,7 @@
                 <div class="fightNo">{{ item.carrierFlights || item.inflightNo }}</div>
                 <div class="fightDate">{{ item.carrierFlightsDate || item.inflightDate }}</div>
                 <div class="fightLine">{{ item.outAirport }}{{ item.takeoff_terminal }} -- {{item.landAirport}}{{ item.target_terminal }}</div>
-                <div class="fightTime">{{ item.takeoff_time }} -- {{ item.land_time }}</div>
+                <div class="fightTime">{{ item.takeTime }} -- {{ item.landTime }}</div>
               </div>
               <div class="baggage-track-chart">
                 <div class="step-line">
@@ -125,6 +125,7 @@ export default {
         }
       ],
       tableData: [],
+      tableDataCopy: [],
       page: 0,
       pageSize: 20,
       dataContent: {},
@@ -168,7 +169,7 @@ export default {
         this.load()
       },
       deep: true
-    }
+    },
   },
   created () {
     this.dataContent = this.queryObj
@@ -188,10 +189,10 @@ export default {
           returnData.forEach(item => {
             item.bagStatus = _.cloneDeep(this.stepNodes)
           })
-          this.tableData.push(...returnData);
-          this.tableData = _.uniqBy(this.tableData, 'carrierFlights')
-          this.tableData = this.tableData.sort((a, b) => Date.parse(a.carrierFlightsDate) - Date.parse(b.carrierFlightsDate))
-          this.tableData.forEach(item => {
+          this.tableDataCopy.push(...returnData);
+          this.tableDataCopy = _.uniqBy(this.tableDataCopy, 'carrierFlights')
+          this.tableDataCopy = this.tableDataCopy.sort((a, b) => Date.parse(a.carrierFlightsDate) - Date.parse(b.carrierFlightsDate))
+          this.tableDataCopy.forEach(item => {
             item.bagStatus.map(p => {
               const { timeProp, loclProp, stateProp } = p
               if (item.hasOwnProperty(timeProp) || item.hasOwnProperty(loclProp) || item.hasOwnProperty(stateProp)) {
@@ -201,6 +202,7 @@ export default {
               }
             })
           })
+          this.getBagTime(this.tableDataCopy)
           this.loading = false;
         } else {
           this.page--;
@@ -226,6 +228,27 @@ export default {
         this.getLuggageList(SERVICE_ID.bagTableId, this.dataContent, ++this.page, this.pageSize);
       }
     },
+    getBagTime (arr) {
+      arr.forEach(async item => {
+        const { carrierFlights, carrierFlightsDate, outAirport, landAirport } = item
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.baggageTime, {
+          carrierFlights,
+          carrierFlightsDate,
+          outAirport,
+          landAirport
+        })
+        if (code == 0 && returnData && returnData.length) {
+          const newArray = [...returnData]
+          const itemObj = newArray[0]
+          const { actualTakeOffTime, estimateTakeOffTime, scheduleTakeOffTime, actualLandInTime, estimateLandInTime, scheduleLandInTime } = itemObj
+          item.newTakeoff_time = actualTakeOffTime ? actualTakeOffTime : estimateTakeOffTime ? estimateTakeOffTime : scheduleTakeOffTime
+          item.newLand_time = actualLandInTime ? actualLandInTime : estimateLandInTime ? estimateLandInTime : scheduleLandInTime
+          item.takeTime = item.newTakeoff_time.split('T').at(-1)
+          item.landTime = item.newLand_time.split('T').at(-1)
+        }
+      })
+      this.tableData = [...this.tableDataCopy]
+    }
   }
 }
 </script>
@@ -275,6 +298,9 @@ export default {
           .fightLine {
             margin-bottom: 8px;
           }
+          .fightTime {
+            margin-top: 13px;
+          }
         }
         .type {
           font-size: 18px;