|
@@ -5,25 +5,19 @@ import { CommonData, MaybeRef } from '~/common'
|
|
interface TrackNode {
|
|
interface TrackNode {
|
|
name: string
|
|
name: string
|
|
nodeCode: string
|
|
nodeCode: string
|
|
- active: boolean
|
|
|
|
|
|
+ flag: boolean
|
|
labelWidth?: number
|
|
labelWidth?: number
|
|
descriptions: string[]
|
|
descriptions: string[]
|
|
- sync?: boolean
|
|
|
|
}
|
|
}
|
|
-interface CombinedTrackNode {
|
|
|
|
- active: boolean
|
|
|
|
- labelWidth?: number
|
|
|
|
- children: [TrackNode, TrackNode]
|
|
|
|
-}
|
|
|
|
-interface TrackAirport<T = TrackNode> {
|
|
|
|
|
|
+interface TrackAirport {
|
|
airport: string
|
|
airport: string
|
|
isDeparture: boolean
|
|
isDeparture: boolean
|
|
- trackSteps: T[]
|
|
|
|
|
|
+ trackSteps: TrackNode[]
|
|
}
|
|
}
|
|
-interface TrackAirline<T = TrackNode> {
|
|
|
|
|
|
+interface TrackAirline {
|
|
flightNO: string
|
|
flightNO: string
|
|
flightDate: string
|
|
flightDate: string
|
|
- airports: TrackAirport<T>[]
|
|
|
|
|
|
+ airports: TrackAirport[]
|
|
}
|
|
}
|
|
|
|
|
|
const trackNodesMap = {
|
|
const trackNodesMap = {
|
|
@@ -38,13 +32,12 @@ const trackNodesMap = {
|
|
// },
|
|
// },
|
|
{
|
|
{
|
|
name: '安检',
|
|
name: '安检',
|
|
- nodeCode: '安检',
|
|
|
|
|
|
+ nodeCode: 'SECURITY_CHECK',
|
|
// nodeCode: 'SECURITY', // 临时-复制加货
|
|
// nodeCode: 'SECURITY', // 临时-复制加货
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '加货',
|
|
name: '加货',
|
|
nodeCode: 'ACC_BUP',
|
|
nodeCode: 'ACC_BUP',
|
|
- sync: true,
|
|
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '预配载',
|
|
name: '预配载',
|
|
@@ -111,7 +104,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '出库',
|
|
name: '出库',
|
|
- nodeCode: 'FSUDLV',
|
|
|
|
|
|
+ nodeCode: 'FSU_DLV',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
internationalDeparture: [
|
|
internationalDeparture: [
|
|
@@ -121,7 +114,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '海关',
|
|
name: '海关',
|
|
- nodeCode: 'MTREL_out',
|
|
|
|
|
|
+ nodeCode: 'MTREL',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '运抵',
|
|
name: '运抵',
|
|
@@ -137,11 +130,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '理货',
|
|
name: '理货',
|
|
- nodeCode: 'ACC_BUP',
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name: '实配',
|
|
|
|
- nodeCode: 'LS_CARGO',
|
|
|
|
|
|
+ nodeCode: 'CARTON_LIST',
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
// name: '待运区',
|
|
// name: '待运区',
|
|
@@ -168,6 +157,10 @@ const trackNodesMap = {
|
|
nodeCode: 'CARGOS_OFFLOAD',
|
|
nodeCode: 'CARGOS_OFFLOAD',
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
|
|
+ // name: '实配',
|
|
|
|
+ // nodeCode: 'LS_CARGO',
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
// name: '退运',
|
|
// name: '退运',
|
|
// nodeCode: '',
|
|
// nodeCode: '',
|
|
// },
|
|
// },
|
|
@@ -187,7 +180,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '理货',
|
|
name: '理货',
|
|
- nodeCode: 'RCF报',
|
|
|
|
|
|
+ nodeCode: 'RCF',
|
|
},
|
|
},
|
|
// {
|
|
// {
|
|
// name: '快件运抵',
|
|
// name: '快件运抵',
|
|
@@ -195,11 +188,11 @@ const trackNodesMap = {
|
|
// },
|
|
// },
|
|
{
|
|
{
|
|
name: '海关放行',
|
|
name: '海关放行',
|
|
- nodeCode: 'MTREL_in',
|
|
|
|
|
|
+ nodeCode: 'MTREL',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '出库',
|
|
name: '出库',
|
|
- nodeCode: 'DLV报',
|
|
|
|
|
|
+ nodeCode: 'DLV',
|
|
},
|
|
},
|
|
],
|
|
],
|
|
internationalDepartureTransfer: [
|
|
internationalDepartureTransfer: [
|
|
@@ -209,7 +202,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '海关',
|
|
name: '海关',
|
|
- nodeCode: 'MTREL_out',
|
|
|
|
|
|
+ nodeCode: 'MTREL',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '运抵',
|
|
name: '运抵',
|
|
@@ -225,7 +218,7 @@ const trackNodesMap = {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '理货',
|
|
name: '理货',
|
|
- nodeCode: 'ACC_BUP',
|
|
|
|
|
|
+ nodeCode: 'CARTON_LIST',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: '实配',
|
|
name: '实配',
|
|
@@ -255,7 +248,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
return unref(trackData)
|
|
return unref(trackData)
|
|
})
|
|
})
|
|
|
|
|
|
- const trackAirlines = ref<TrackAirline<TrackNode | CombinedTrackNode>[]>([])
|
|
|
|
|
|
+ const trackAirlines = ref<TrackAirline[]>([])
|
|
const getTrackAirlines = () => {
|
|
const getTrackAirlines = () => {
|
|
const airlines = unref(computedTrackData).reduce(
|
|
const airlines = unref(computedTrackData).reduce(
|
|
(
|
|
(
|
|
@@ -280,24 +273,25 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
...trackNodesMap.departure,
|
|
...trackNodesMap.departure,
|
|
...trackNodesMap.internationalDeparture,
|
|
...trackNodesMap.internationalDeparture,
|
|
...trackNodesMap.internationalDepartureTransfer,
|
|
...trackNodesMap.internationalDepartureTransfer,
|
|
- ].some(node => node.nodeCode === nodeCode) ||
|
|
|
|
|
|
+ ].some((node) => node.nodeCode === nodeCode) ||
|
|
(name.includes('Departure') &&
|
|
(name.includes('Departure') &&
|
|
![
|
|
![
|
|
...trackNodesMap.arrival,
|
|
...trackNodesMap.arrival,
|
|
...trackNodesMap.internationalArrival,
|
|
...trackNodesMap.internationalArrival,
|
|
- ].some(node => node.nodeCode === nodeCode))
|
|
|
|
|
|
+ ].some((node) => node.nodeCode === nodeCode))
|
|
const airport = isDeparture
|
|
const airport = isDeparture
|
|
? String(departureAirport ?? '')
|
|
? String(departureAirport ?? '')
|
|
: String(arriveAirport ?? '')
|
|
: String(arriveAirport ?? '')
|
|
const trackNode = {
|
|
const trackNode = {
|
|
- active: Boolean(
|
|
|
|
- // execPosition ||
|
|
|
|
- // ConsignmentItemPackagingQuantityQuantity ||
|
|
|
|
- execResult || execTime
|
|
|
|
|
|
+ flag: Boolean(
|
|
|
|
+ execPosition ||
|
|
|
|
+ ConsignmentItemPackagingQuantityQuantity ||
|
|
|
|
+ execResult ||
|
|
|
|
+ execTime
|
|
),
|
|
),
|
|
descriptions: [
|
|
descriptions: [
|
|
- // String(execPosition ?? ''),
|
|
|
|
- // String(ConsignmentItemPackagingQuantityQuantity ?? ''),
|
|
|
|
|
|
+ String(execPosition ?? ''),
|
|
|
|
+ String(ConsignmentItemPackagingQuantityQuantity ?? ''),
|
|
execResult ? '通过' : '未通过',
|
|
execResult ? '通过' : '未通过',
|
|
datetimeToTime(execTime, flightDate),
|
|
datetimeToTime(execTime, flightDate),
|
|
],
|
|
],
|
|
@@ -312,7 +306,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
: isInternational
|
|
: isInternational
|
|
? 'internationalArrival'
|
|
? 'internationalArrival'
|
|
: 'arrival'
|
|
: 'arrival'
|
|
- ].map(node => {
|
|
|
|
|
|
+ ].map((node) => {
|
|
if (node.nodeCode === nodeCode) {
|
|
if (node.nodeCode === nodeCode) {
|
|
return {
|
|
return {
|
|
...node,
|
|
...node,
|
|
@@ -321,22 +315,22 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
} else {
|
|
} else {
|
|
return {
|
|
return {
|
|
...node,
|
|
...node,
|
|
- active: false,
|
|
|
|
- descriptions: ['', ''],
|
|
|
|
|
|
+ flag: false,
|
|
|
|
+ descriptions: [],
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
const airline = airlines.find(
|
|
const airline = airlines.find(
|
|
- airline =>
|
|
|
|
|
|
+ (airline) =>
|
|
airline.flightNO === flightNO &&
|
|
airline.flightNO === flightNO &&
|
|
airline.flightDate === airline.flightDate
|
|
airline.flightDate === airline.flightDate
|
|
)
|
|
)
|
|
if (airline) {
|
|
if (airline) {
|
|
const trackAirport = airline.airports.find(
|
|
const trackAirport = airline.airports.find(
|
|
- trackAirport => trackAirport.airport === airport
|
|
|
|
|
|
+ (trackAirport) => trackAirport.airport === airport
|
|
)
|
|
)
|
|
if (trackAirport) {
|
|
if (trackAirport) {
|
|
- trackAirport.trackSteps = trackAirport.trackSteps.map(node => {
|
|
|
|
|
|
+ trackAirport.trackSteps = trackAirport.trackSteps.map((node) => {
|
|
if (node.nodeCode === nodeCode) {
|
|
if (node.nodeCode === nodeCode) {
|
|
node = {
|
|
node = {
|
|
...node,
|
|
...node,
|
|
@@ -369,44 +363,22 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
},
|
|
},
|
|
[] as TrackAirline[]
|
|
[] as TrackAirline[]
|
|
)
|
|
)
|
|
- trackAirlines.value = airlines.map(airline => {
|
|
|
|
|
|
+ trackAirlines.value = airlines.map((airline) => {
|
|
const dealedAirports = airline.airports.map((airport, index) => ({
|
|
const dealedAirports = airline.airports.map((airport, index) => ({
|
|
...airport,
|
|
...airport,
|
|
- trackSteps: airport.trackSteps.reduce((prevSteps, node, i, steps) => {
|
|
|
|
- if (
|
|
|
|
- node.active ||
|
|
|
|
|
|
+ trackSteps: airport.trackSteps.filter(
|
|
|
|
+ (node, i, steps) =>
|
|
|
|
+ node.flag ||
|
|
(index > 0
|
|
(index > 0
|
|
? ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
|
|
? ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
|
|
steps.some(
|
|
steps.some(
|
|
- node =>
|
|
|
|
- ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
|
|
|
|
- node.active
|
|
|
|
|
|
+ (node) =>
|
|
|
|
+ ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) && node.flag
|
|
)
|
|
)
|
|
: !['CARGOS_OFFLOAD', 'OFFLOAD_CONFIRM', 'BILL_RETURN'].includes(
|
|
: !['CARGOS_OFFLOAD', 'OFFLOAD_CONFIRM', 'BILL_RETURN'].includes(
|
|
node.nodeCode
|
|
node.nodeCode
|
|
))
|
|
))
|
|
- ) {
|
|
|
|
- if (node.sync && prevSteps.length > 0) {
|
|
|
|
- const lastNode = prevSteps.pop() as TrackNode | CombinedTrackNode
|
|
|
|
- if ('nodeCode' in lastNode) {
|
|
|
|
- const active = node.active || lastNode.active
|
|
|
|
- const labelWidth =
|
|
|
|
- Math.max(node.labelWidth ?? 0, lastNode.labelWidth ?? 0) ||
|
|
|
|
- undefined
|
|
|
|
- prevSteps.push({
|
|
|
|
- active,
|
|
|
|
- labelWidth,
|
|
|
|
- children: [lastNode, node],
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- prevSteps.push(lastNode, node)
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- prevSteps.push(node)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return prevSteps
|
|
|
|
- }, [] as (TrackNode | CombinedTrackNode)[]),
|
|
|
|
|
|
+ ),
|
|
}))
|
|
}))
|
|
const sortedAirports =
|
|
const sortedAirports =
|
|
name.includes('Departure') === airline.airports[0].isDeparture
|
|
name.includes('Departure') === airline.airports[0].isDeparture
|
|
@@ -424,10 +396,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
|
|
})
|
|
})
|
|
|
|
|
|
const trackBoxStyle = computed(
|
|
const trackBoxStyle = computed(
|
|
- () => (
|
|
|
|
- airports: TrackAirport<TrackNode | CombinedTrackNode>[],
|
|
|
|
- index: number
|
|
|
|
- ) => {
|
|
|
|
|
|
+ () => (airports: TrackAirport[], index: number) => {
|
|
const style: CSSProperties = {}
|
|
const style: CSSProperties = {}
|
|
const totalLength = airports.reduce((pre, current) => {
|
|
const totalLength = airports.reduce((pre, current) => {
|
|
return pre + current.trackSteps.length - 1
|
|
return pre + current.trackSteps.length - 1
|