zhaoke 1 рік тому
батько
коміт
26c15db457

+ 12 - 3
src/views/bagDetailsPage/components/baggageView.vue

@@ -167,9 +167,18 @@ export default {
     getViewData () {
       const bagQueryParams = JSON.parse(sessionStorage.getItem('bagQueryParams')) || ''
       if (bagQueryParams) {
-        this.dataContent = bagQueryParams
-        this.restTable()
-        this.load()
+        const { luggageNum } = this.$route.query
+        if (luggageNum) {
+          if (luggageNum == bagQueryParams.luggageNum) {
+            this.dataContent = bagQueryParams
+            this.restTable()
+            this.load()
+          }
+        } else {
+          this.dataContent = bagQueryParams
+          this.restTable()
+          this.load()
+        }
       }
     },
     //获取行李信息

+ 67 - 0
src/views/flightPage/components/flightTable.vue

@@ -101,6 +101,58 @@ export default {
       ],
     }
   },
+  created () {
+    const query = this.$route.query;
+    const np = [
+      {
+        k1: "inflightNo",
+        k2: "inflightDate",
+      },
+      {
+        k1: "transferFlightNO",
+        k2: "outflightDate",
+      },
+      {
+        k1: "Inbound_flight_number",
+        k2: "Inbound_flight_date",
+      },
+      {
+        k1: "departure_flights_number",
+        k2: "departure_flights_date",
+      },
+    ];
+    const nq = this.formatParams(np, { ...query });
+    const filterMap = {
+      Inbound_flight_number: "inflightNo",
+      departure_flights_number: "transferFlightNO",
+    };
+    Object.entries(nq).forEach(([key, value]) => {
+      if (
+        ![
+          "carrierFlights",
+          "carrierFlightsDate",
+          "outAirport",
+          "landAirport",
+        ].includes(key)
+      ) {
+        if (filterMap[key]) {
+          this.selectedFilter = [filterMap[key], value];
+        }
+        delete nq[key];
+      }
+    });
+    let tableKey = null;
+    Object.keys({ ...query }).forEach((key) => {
+      const findKey = this.viewClassName.filter((item) => item.value === key);
+      if (findKey?.length) {
+        tableKey = [...findKey];
+      }
+    });
+    if (tableKey?.length) {
+      const { value } = tableKey[0];
+      this.selectedFilter = [value];
+    }
+  },
   computed: {
     fastFilter () {
       const [key, value] = this.selectedFilter;
@@ -151,6 +203,21 @@ export default {
     },
   },
   methods: {
+    //格式化参数-航班号
+    formatParams (arr = [], query = {}) {
+      if (arr && arr.length) {
+        for (let index = 0; index < arr.length; index++) {
+          const { k1, k2 } = arr[index];
+          if (query[k2]) {
+            query.carrierFlights = query[k1];
+            query.carrierFlightsDate = query[k2];
+            delete query[k1];
+            delete query[k2];
+          }
+        }
+      }
+      return query;
+    },
     // 获取行李列表后设置快捷筛选
     tableLoad (tableData) {
       this.setFastFilterOptions(tableData);