|
@@ -99,30 +99,29 @@ export default {
|
|
|
async created () {
|
|
|
const checkDatas = []
|
|
|
const query = this.$route.query
|
|
|
- if (query.inflightNo || query.inflightDate) {
|
|
|
- query.carrierFlights = query.inflightNo
|
|
|
- query.carrierFlightsDate = query.inflightDate
|
|
|
- }
|
|
|
- if (query.transferFlightNO || query.outflightDate) {
|
|
|
- query.carrierFlights = query.inflightNo
|
|
|
- query.carrierFlightsDate = query.outflightDate
|
|
|
- }
|
|
|
- if (query.Inbound_flight_number || query.Inbound_flight_date) {
|
|
|
- query.carrierFlights = query.Inbound_flight_number
|
|
|
- query.carrierFlightsDate = query.Inbound_flight_date
|
|
|
- }
|
|
|
- if (query.Inbound_flight_number || query.Inbound_flight_date) {
|
|
|
- query.carrierFlights = query.Inbound_flight_number
|
|
|
- query.carrierFlightsDate = query.Inbound_flight_date
|
|
|
- }
|
|
|
- if (query.departure_flights_number || query.departure_flights_date) {
|
|
|
- query.carrierFlights = query.departure_flights_number
|
|
|
- query.carrierFlightsDate = query.departure_flights_date
|
|
|
- }
|
|
|
- const { carrierFlights, carrierFlightsDate } = query
|
|
|
- this.flightObj = query
|
|
|
- this.dataContent = query
|
|
|
- const res = await this.getViewInfo(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 { carrierFlights, carrierFlightsDate } = nq
|
|
|
+ this.flightObj = nq
|
|
|
+ this.dataContent = nq
|
|
|
+ const res = await this.getViewInfo(nq)
|
|
|
this.infoObj = res[0]
|
|
|
const sts = await this.getViewInfo({ carrierFlights, carrierFlightsDate })
|
|
|
if (sts && sts.length) {
|
|
@@ -160,6 +159,21 @@ export default {
|
|
|
this.table2 = this.dataContent
|
|
|
},
|
|
|
methods: {
|
|
|
+ //格式化参数-航班号
|
|
|
+ formatParams (arr = [], query = {}) {
|
|
|
+ if (arr && arr.length) {
|
|
|
+ for (let index = 0; index < arr.length; index++) {
|
|
|
+ const { k1, k2 } = arr[index];
|
|
|
+ if (query[k1] || query[k2]) {
|
|
|
+ query.carrierFlights = query[k1]
|
|
|
+ query.carrierFlightsDate = query[k2]
|
|
|
+ delete query[k1]
|
|
|
+ delete query[k2]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return query
|
|
|
+ },
|
|
|
// 获取基本信息
|
|
|
async getViewInfo (dataContent = this.dataContent) {
|
|
|
const { code, returnData } = await this.getQueryList(SERVICE_ID.bagViewId, dataContent)
|