zhaoke 1 jaar geleden
bovenliggende
commit
d2369bfa37
1 gewijzigde bestanden met toevoegingen van 7 en 5 verwijderingen
  1. 7 5
      src/views/newBagDetails/components/baggageView.vue

+ 7 - 5
src/views/newBagDetails/components/baggageView.vue

@@ -125,6 +125,7 @@ export default {
         }
       ],
       tableData: [],
+      tableDataCopy: [],
       page: 0,
       pageSize: 20,
       dataContent: {},
@@ -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,7 +202,7 @@ export default {
               }
             })
           })
-          this.getBagTime(this.tableData)
+          this.getBagTime(this.tableDataCopy)
           this.loading = false;
         } else {
           this.page--;
@@ -246,6 +247,7 @@ export default {
           item.landTime = item.newLand_time.split('T').at(-1)
         }
       })
+      this.tableData = [...this.tableDataCopy]
     }
   }
 }