|
@@ -334,6 +334,34 @@ export default {
|
|
|
return datas
|
|
|
},
|
|
|
// 获取表格数据
|
|
|
+ async getQueryRow (id, dataContent = this.dataContent, page, pageSize) {
|
|
|
+ try {
|
|
|
+ const params = {} || dataContent
|
|
|
+ if (dataContent.filter && dataContent.filter?.length) {
|
|
|
+ params['fd1'] = dataContent.filter[0].value
|
|
|
+ params['fd2'] = dataContent.filter[1].value
|
|
|
+ params['airport'] = dataContent.filter[2].value
|
|
|
+ } else {
|
|
|
+ params['fd1'] = dataContent.departure_flights_date1
|
|
|
+ params['fd2'] = dataContent.departure_flights_date2
|
|
|
+ params['airport'] = dataContent.current_airport
|
|
|
+ }
|
|
|
+ const { code, returnData } = await this.getQueryListAuth(
|
|
|
+ id,
|
|
|
+ params,
|
|
|
+ page,
|
|
|
+ pageSize
|
|
|
+ )
|
|
|
+ if (code == 0) {
|
|
|
+ return returnData
|
|
|
+ } else {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取表格数据
|
|
|
async getQuery (id, dataContent = this.dataContent, page, pageSize) {
|
|
|
try {
|
|
|
if (this.shouldReset) {
|
|
@@ -445,7 +473,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 初始化表格
|
|
|
- initTableData (tableData) {
|
|
|
+ async initTableData (tableData) {
|
|
|
tableData.forEach(async row => {
|
|
|
if (row.needGroup) {
|
|
|
this.tableGroups.push(row.columnName)
|
|
@@ -454,8 +482,26 @@ export default {
|
|
|
const now = new Date()
|
|
|
if (this.$route.path == '/newDeparture') {
|
|
|
this.leaveCount = 0
|
|
|
+ const tableMap = new Map()
|
|
|
const nTableData = [...tableData]
|
|
|
+ const nTableDataRow = await this.getQueryRow(SERVICE_ID.departureDanggerId, this.dataContent, 1, 999)
|
|
|
+ if (nTableDataRow?.length) {
|
|
|
+ nTableDataRow.map(({ carrierFlights, carrierFlightsDate, craftType_num, depstandCd_num, landAirport, outAirport }) => {
|
|
|
+ tableMap.set(carrierFlights + carrierFlightsDate + landAirport + outAirport, `${craftType_num}` + '-' + `${depstandCd_num}`)
|
|
|
+ })
|
|
|
+ }
|
|
|
const cData = nTableData.filter(row => Number(row['NO_BSM_number']) + Number(row['check_in_baggage_number']) > 0)
|
|
|
+ if (tableMap.size) {
|
|
|
+ cData.map(item => {
|
|
|
+ const { carrierFlights, carrierFlightsDate, landAirport, outAirport } = item
|
|
|
+ const itemKey = carrierFlights + carrierFlightsDate + landAirport + outAirport
|
|
|
+ if (tableMap.has(itemKey)) {
|
|
|
+ const [craftType_num, depstandCd_num] = tableMap.get(itemKey)?.split('-')
|
|
|
+ item.craftType_num = Number(craftType_num)
|
|
|
+ item.depstandCd_num = Number(depstandCd_num)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
cData.forEach(row => {
|
|
|
if (row.abnormalState === 'CAN') {
|
|
|
row.canceled = 'Y'
|
|
@@ -469,7 +515,25 @@ export default {
|
|
|
if (this.$route.path == '/newArrival') {
|
|
|
this.arriveCount = 0
|
|
|
const nTableData = [...tableData]
|
|
|
+ const tableMap = new Map()
|
|
|
+ const nTableDataRow = await this.getQueryRow(SERVICE_ID.arrivalDanggerId, this.dataContent, 1, 999)
|
|
|
+ if (nTableDataRow?.length) {
|
|
|
+ nTableDataRow.map(({ carrierFlights, carrierFlightsDate, craftType_num, arrstandCd_num, landAirport, outAirport }) => {
|
|
|
+ tableMap.set(carrierFlights + carrierFlightsDate + landAirport + outAirport, `${craftType_num}` + '-' + `${arrstandCd_num}`)
|
|
|
+ })
|
|
|
+ }
|
|
|
const cData = nTableData.filter(row => Number(row['NO_BSM_number']) + Number(row['check_in_baggage_number']) > 0)
|
|
|
+ if (tableMap.size) {
|
|
|
+ cData.map(item => {
|
|
|
+ const { carrierFlights, carrierFlightsDate, landAirport, outAirport } = item
|
|
|
+ const itemKey = carrierFlights + carrierFlightsDate + landAirport + outAirport
|
|
|
+ if (tableMap.has(itemKey)) {
|
|
|
+ const [craftType_num, arrstandCd_num] = tableMap.get(itemKey)?.split('-')
|
|
|
+ item.craftType_num = Number(craftType_num)
|
|
|
+ item.arrstandCd_num = Number(arrstandCd_num)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
cData.forEach(row => {
|
|
|
if (row.abnormalState === 'CAN') {
|
|
|
row.canceled = 'Y'
|
|
@@ -483,6 +547,41 @@ export default {
|
|
|
if (this.$route.path.startsWith('/newTransfer')) {
|
|
|
this.leaveCount = 0
|
|
|
const nTableData = [...tableData]
|
|
|
+ const [tableMap1, tableMap2] = [new Map(), new Map()]
|
|
|
+ const nTableDataRow1 = await this.getQueryRow(SERVICE_ID.departureAviLtDanggerId, this.dataContent, 1, 999) //离港数据
|
|
|
+ const nTableDataRow2 = await this.getQueryRow(SERVICE_ID.departureAviDanggerId, this.dataContent, 1, 999) //进港数据
|
|
|
+ if (nTableDataRow1?.length) {
|
|
|
+ nTableDataRow1.map(({ carrierFlights, carrierFlightsDate, craftType_num, depstandCd_num, outAirport }) => {
|
|
|
+ tableMap1.set(carrierFlights + carrierFlightsDate + outAirport, `${craftType_num}` + '-' + `${depstandCd_num}`)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (nTableDataRow2?.length) {
|
|
|
+ nTableDataRow2.map(({ carrierFlights, carrierFlightsDate, craftType_num, arrstandCd_num, landAirport }) => {
|
|
|
+ tableMap2.set(carrierFlights + carrierFlightsDate + landAirport, `${craftType_num}` + '-' + `${arrstandCd_num}`)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (tableMap1.size) {
|
|
|
+ nTableData.map(item => {
|
|
|
+ const { departure_flights_number, departure_flights_date, current_airport } = item
|
|
|
+ const itemKey = departure_flights_number + departure_flights_date + current_airport
|
|
|
+ if (tableMap1.has(itemKey)) {
|
|
|
+ const [craftType_num, depstandCd_num] = tableMap1.get(itemKey)?.split('-')
|
|
|
+ item.craftType_num = Number(craftType_num)
|
|
|
+ item.depstandCd_num = Number(depstandCd_num)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (tableMap2.size) {
|
|
|
+ nTableData.map(item => {
|
|
|
+ const { Inbound_flight_number, Inbound_flight_date, current_airport } = item
|
|
|
+ const itemKey = Inbound_flight_number + Inbound_flight_date + current_airport
|
|
|
+ if (tableMap2.has(itemKey)) {
|
|
|
+ const [craftType_num, arrstandCd_num] = tableMap2.get(itemKey)?.split('-')
|
|
|
+ item.craftType_num = Number(craftType_num)
|
|
|
+ item.arrstandCd_num = Number(arrstandCd_num)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
nTableData.forEach(row => {
|
|
|
if (row.departure_flights_leave_date && new Date(row.departure_flights_leave_date) < now) {
|
|
|
row.hasTakenOff = 'Y'
|
|
@@ -656,6 +755,31 @@ export default {
|
|
|
if (column.property === 'scon_number' && row['scon_number'] && row['scon_number'] != 0) {
|
|
|
classes.push('cell-toUnload')
|
|
|
}
|
|
|
+ if (column.property === 'depstandCd' && row['depstandCd_num'] >= 2) {
|
|
|
+ classes.push('cell-toUnload')
|
|
|
+ }
|
|
|
+ if (column.property === 'craftNo' && row['craftType_num'] >= 2) {
|
|
|
+ classes.push('cell-toUnload')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.$route.path == '/newArrival') {
|
|
|
+ if (column.property === 'arrstandCd' && row['arrstandCd_num'] >= 2) {
|
|
|
+ classes.push('cell-toUnload')
|
|
|
+ }
|
|
|
+ if (column.property === 'craftNo' && row['craftType_num'] >= 2) {
|
|
|
+ classes.push('cell-toUnload')
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.$route.path.startsWith('/newTransfer')) {
|
|
|
+ if (column.property === 'Inbound_flight_stand' && row['arrstandCd_num'] >= 2) {
|
|
|
+ classes.push('cell-toUnload')
|
|
|
+ }
|
|
|
+ if (column.property === 'departure_flights_leave_stand' && row['depstandCd_num'] >= 2) {
|
|
|
+ classes.push('cell-toUnload')
|
|
|
+ }
|
|
|
+ if (column.property === 'craftNo' && row['craftType_num'] >= 2) {
|
|
|
+ classes.push('cell-toUnload')
|
|
|
+ }
|
|
|
}
|
|
|
return classes.join(' ')
|
|
|
},
|