Browse Source

运单节点列表修改

zhongxiaoyu 1 year ago
parent
commit
3b0828721f

+ 99 - 31
public/extraConfig.js

@@ -1,35 +1,103 @@
 var NODE_CODE = {
-  NEW: '获取运单',
-  FWB: '获取运单',
-  DEH: '收运核单',
-  ACC_CHECK: '查验',
-  ACC_BUP: '加货',
-  LS_CARGO: '预配载',
-  FSUDEP: '预配载',
-  FSU_DEP: '预配载',
-  CARGOS_HANDOVER_STATUS_02: '货站交接',
-  CARGOS_HANDOVER_STATUS_03: '交接复核',
-  出港货邮: '机下交接',
-  装载完成: '装机完成',
-  货舱关闭: '关货舱门',
-  CARGOS_OFFLOAD: '拉下登记',
-  OFFLOAD_CONFIRM: '拉下确认',
-  BILL_RETURN: '退运',
-  CARGOS_ARR_HANDOVER: '卸机',
-  CARGOS_HANDOVER_STATUS_01: '机下交接',
-  CARGOS_HANDOVER_STATUS_99: '货站交接',
-  IMP_TALLY: '理货',
-  FSU_DLV: '出库',
-  FSUDLV: '出库',
-  EPORTREL: '入园',
-  FOH: '运抵货站',
-  MTREL_out: '海关放行',
-  RCS: '收运核单',
-  MTREL_in: '海关放行',
-  MTREL: '海关放行',
-  DLV: '出库',
-  RCF报: '理货',
-  CARGOS_HANDOVER_STATUS99: '货站交接',
+  common: [
+    { nodeName: '获取运单', nodeCode: 'NEW' },
+    { nodeName: '获取运单', nodeCode: 'FWB' },
+    { nodeName: '收运核单', nodeCode: 'DEH' },
+    { nodeName: '查验', nodeCode: 'ACC_CHECK' },
+    { nodeName: '加货', nodeCode: 'ACC_BUP' },
+    { nodeName: '预配载', nodeCode: 'LS_CARGO' },
+    { nodeName: '预配载', nodeCode: 'FSUDEP' },
+    { nodeName: '预配载', nodeCode: 'FSU_DEP' },
+    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_02' },
+    { nodeName: '交接复核', nodeCode: 'CARGOS_HANDOVER_STATUS_03' },
+    { nodeName: '机下交接', nodeCode: '出港货邮' },
+    { nodeName: '装机完成', nodeCode: '装载完成' },
+    { nodeName: '关货舱门', nodeCode: '货舱关闭' },
+    { nodeName: '拉下登记', nodeCode: 'CARGOS_OFFLOAD' },
+    { nodeName: '拉下确认', nodeCode: 'OFFLOAD_CONFIRM' },
+    { nodeName: '退运', nodeCode: 'BILL_RETURN' },
+    { nodeName: '卸机', nodeCode: 'CARGOS_ARR_HANDOVER' },
+    { nodeName: '机下交接', nodeCode: 'CARGOS_HANDOVER_STATUS_01' },
+    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_99' },
+    { nodeName: '理货', nodeCode: 'IMP_TALLY' },
+    { nodeName: '出库', nodeCode: 'FSU_DLV' },
+    { nodeName: '出库', nodeCode: 'FSUDLV' },
+    { nodeName: '入园', nodeCode: 'EPORTREL' },
+    { nodeName: '运抵货站', nodeCode: 'FOH' },
+    { nodeName: '海关放行', nodeCode: 'MTREL_out' },
+    { nodeName: '收运核单', nodeCode: 'RCS' },
+    { nodeName: '海关放行', nodeCode: 'MTREL_in' },
+    { nodeName: '海关放行', nodeCode: 'MTREL' },
+    { nodeName: '出库', nodeCode: 'DLV' },
+    { nodeName: '理货', nodeCode: 'RCF报' },
+    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS99' },
+  ],
+  departure: [
+    { nodeName: '收运核单', nodeCode: 'DEH' },
+    // { nodeName: '收运核查', nodeCode: 'ACC_CHECK' },
+    {
+      nodeName: '安检',
+      nodeCode: '安检',
+      // nodeCode: 'SECURITY', // 临时-复制加货
+    },
+    {
+      nodeName: '加货',
+      nodeCode: 'ACC_BUP',
+      sync: true, // sync为true时与前一个节点并列显示
+    },
+    { nodeName: '预配载', nodeCode: 'LS_CARGO' },
+    // { nodeName: '待运区', nodeCode: 'WAT_LOC' },
+    // { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_02' },
+    { nodeName: '交接复核', nodeCode: 'CARGOS_HANDOVER_STATUS_03' },
+    { nodeName: '机下交接', nodeCode: '出港货邮' },
+    { nodeName: '装机', nodeCode: '装载完成' },
+    { nodeName: '关闭舱门', nodeCode: '关闭舱门' },
+    { nodeName: '拉下登记', nodeCode: 'CARGOS_OFFLOAD' },
+    { nodeName: '拉回确认', nodeCode: 'OFFLOAD_CONFIRM' },
+    // { nodeName: '起飞', nodeCode: 'TAKEOFF', // 待定 },
+    { nodeName: '退运', nodeCode: 'BILL_RETURN' },
+  ],
+  arrival: [
+    { nodeName: '卸机', nodeCode: 'CARGOS_ARR_HANDOVER' },
+    { nodeName: '库区到达', nodeCode: 'CARGOS_HANDOVER_STATUS_01' },
+    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_99' },
+    { nodeName: '理货', nodeCode: 'IMP_TALLY' },
+    { nodeName: '出库', nodeCode: 'FSUDLV' },
+  ],
+  internationalDeparture: [
+    { nodeName: '入园', nodeCode: 'EPORTREL' },
+    { nodeName: '海关', nodeCode: 'MTREL_out' },
+    { nodeName: '运抵', nodeCode: 'FOH' },
+    { nodeName: '安检', nodeCode: 'REH' },
+    { nodeName: '收运核单', nodeCode: 'RCS' },
+    { nodeName: '理货', nodeCode: 'ACC_BUP' },
+    { nodeName: '实配', nodeCode: 'LS_CARGO' },
+    // { nodeName: '待运区', nodeCode: 'WAT_LOC' },
+    // { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_02' },
+    { nodeName: '交接复核', nodeCode: 'CARGOS_HANDOVER_STATUS_03' },
+    { nodeName: '机下交接', nodeCode: '出港货邮' },
+    { nodeName: '装机', nodeCode: '装载完成' },
+    { nodeName: '拉下', nodeCode: 'CARGOS_OFFLOAD' },
+    // { nodeName: '退运', nodeCode: '' },
+  ],
+  internationalArrival: [
+    { nodeName: '卸机', nodeCode: 'FFM' },
+    { nodeName: '机下交接', nodeCode: 'CARGOS_HANDOVER_STATUS_01' },
+    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_99' },
+    { nodeName: '理货', nodeCode: 'RCF报' },
+    // { nodeName: '快件运抵', nodeCode: '' },
+    { nodeName: '海关放行', nodeCode: 'MTREL_in' },
+    { nodeName: '出库', nodeCode: 'DLV报' },
+  ],
+  internationalDepartureTransfer: [
+    { nodeName: '入园', nodeCode: 'EPORTREL' },
+    { nodeName: '海关', nodeCode: 'MTREL_out' },
+    { nodeName: '运抵', nodeCode: 'FOH' },
+    { nodeName: '安检', nodeCode: 'REH' },
+    { nodeName: '收运核单', nodeCode: 'RCS' },
+    { nodeName: '理货', nodeCode: 'ACC_BUP' },
+    { nodeName: '实配', nodeCode: 'LS_CARGO' },
+  ],
 }
 
 var MESSAGE_TYPE = {

+ 4 - 4
src/components/steps/index.vue

@@ -22,7 +22,7 @@
           step.nextActive ? 'step-line-active' : 'step-line-inactive',
         ]"
       ></div>
-      <template v-if="'name' in step">
+      <template v-if="'nodeName' in step">
         <div
           :class="[
             'step-state',
@@ -32,7 +32,7 @@
           <i class="step-state-icon" />
         </div>
         <div class="step-info">
-          <div class="step-info-name">{{ step.name }}</div>
+          <div class="step-info-name">{{ step.nodeName }}</div>
           <div class="step-info-desc">
             <span
               class="step-info-desc-item"
@@ -79,7 +79,7 @@
             <i class="step-state-icon" />
           </div>
           <div class="step-info">
-            <div class="step-info-name">{{ subStep.name }}</div>
+            <div class="step-info-name">{{ subStep.nodeName }}</div>
             <div class="step-info-desc">
               <span
                 class="step-info-desc-item"
@@ -99,7 +99,7 @@
 import { CSSProperties, PropType } from 'vue'
 
 type StepData = {
-  name: string
+  nodeName: string
   active: boolean
   preActive?: boolean
   nextActive?: boolean

+ 7 - 8
src/views/realTime/components/FlightView/ContainerWaybillDialog.vue

@@ -182,14 +182,13 @@ const formatter: CommonTableFormatter = (row, column, cellValue, index) => {
     return datetimeToTime(value, flightDate.value)
   }
   if (column.property === 'nodeCode') {
-    if (
-      props.name.includes('International') &&
-      props.name.includes('Departure') &&
-      value === 'LS_CARGO'
-    ) {
-      return '实配'
-    }
-    return NODE_CODE[value] ?? value
+    const name = `${props.name.slice(0, 1).toLowerCase()}${props.name
+      .slice(1)
+      .replace('Flight', '')}`
+    const node =
+      NODE_CODE[name]?.find(node => node.nodeCode === value) ||
+      NODE_CODE.common?.find(node => node.nodeCode === value)
+    return node?.nodeName || value
   }
   if (column.property === 'execResult') {
     // const execResult = Number(cellValue)

+ 7 - 8
src/views/realTime/components/FlightView/index.vue

@@ -185,14 +185,13 @@ const tableFormatter: CommonTableFormatter = (
     }
   }
   if (column.property === 'nodeCode') {
-    if (
-      props.name.includes('International') &&
-      props.name.includes('Departure') &&
-      value === 'LS_CARGO'
-    ) {
-      return '实配'
-    }
-    return NODE_CODE[value] ?? value
+    const name = `${props.name.slice(0, 1).toLowerCase()}${props.name
+      .slice(1)
+      .replace('Flight', '')}`
+    const node =
+      NODE_CODE[name]?.find(node => node.nodeCode === value) ||
+      NODE_CODE.common?.find(node => node.nodeCode === value)
+    return node?.nodeName || value
   }
   if (column.property === 'typeCode' && props.name.includes('International')) {
     return value || '拼货'

+ 30 - 239
src/views/realTime/hooks/useTrackData.ts

@@ -3,7 +3,7 @@ import { CSSProperties } from 'vue'
 import { CommonData, MaybeRef } from '~/common'
 
 interface TrackNode {
-  name: string
+  nodeName: string
   nodeCode: string
   active: boolean
   labelWidth?: number
@@ -26,233 +26,24 @@ interface TrackAirline<T = TrackNode> {
   airports: TrackAirport<T>[]
 }
 
-const trackNodesMap = {
-  departure: [
-    {
-      name: '收运核单',
-      nodeCode: 'DEH',
-    },
-    // {
-    //   name: '收运核查',
-    //   nodeCode: 'ACC_CHECK',
-    // },
-    {
-      name: '安检',
-      nodeCode: '安检',
-      // nodeCode: 'SECURITY', // 临时-复制加货
-    },
-    {
-      name: '加货',
-      nodeCode: 'ACC_BUP',
-      sync: true,
-    },
-    {
-      name: '预配载',
-      nodeCode: 'LS_CARGO',
-    },
-    // {
-    //   name: '待运区',
-    //   nodeCode: 'WAT_LOC',
-    // },
-    // {
-    //   name: '货站交接',
-    //   nodeCode: 'CARGOS_HANDOVER_STATUS_02',
-    // },
-    {
-      name: '交接复核',
-      nodeCode: 'CARGOS_HANDOVER_STATUS_03',
-      // labelWidth: 70,
-    },
-    {
-      name: '机下交接',
-      nodeCode: '出港货邮',
-    },
-    {
-      name: '装机',
-      nodeCode: '装载完成',
-    },
-    {
-      name: '关闭舱门',
-      nodeCode: '关闭舱门',
-    },
-    {
-      name: '拉下登记',
-      nodeCode: 'CARGOS_OFFLOAD',
-    },
-    {
-      name: '拉回确认',
-      nodeCode: 'OFFLOAD_CONFIRM',
-    },
-    // {
-    //   name: '起飞',
-    //   nodeCode: 'TAKEOFF', // 待定
-    // },
-    {
-      name: '退运',
-      nodeCode: 'BILL_RETURN',
-    },
-  ],
-  arrival: [
-    {
-      name: '卸机',
-      nodeCode: 'CARGOS_ARR_HANDOVER',
-    },
-    {
-      name: '库区到达',
-      nodeCode: 'CARGOS_HANDOVER_STATUS_01',
-    },
-    {
-      name: '货站交接',
-      nodeCode: 'CARGOS_HANDOVER_STATUS_99',
-    },
-    {
-      name: '理货',
-      nodeCode: 'IMP_TALLY',
-    },
-    {
-      name: '出库',
-      nodeCode: 'FSUDLV',
-    },
-  ],
-  internationalDeparture: [
-    {
-      name: '入园',
-      nodeCode: 'EPORTREL',
-    },
-    {
-      name: '海关',
-      nodeCode: 'MTREL_out',
-    },
-    {
-      name: '运抵',
-      nodeCode: 'FOH',
-    },
-    {
-      name: '安检',
-      nodeCode: 'REH',
-    },
-    {
-      name: '收运核单',
-      nodeCode: 'RCS',
-    },
-    {
-      name: '理货',
-      nodeCode: 'ACC_BUP',
-    },
-    {
-      name: '实配',
-      nodeCode: 'LS_CARGO',
-    },
-    // {
-    //   name: '待运区',
-    //   nodeCode: 'WAT_LOC',
-    // },
-    // {
-    //   name: '货站交接',
-    //   nodeCode: 'CARGOS_HANDOVER_STATUS_02',
-    // },
-    {
-      name: '交接复核',
-      nodeCode: 'CARGOS_HANDOVER_STATUS_03',
-    },
-    {
-      name: '机下交接',
-      nodeCode: '出港货邮',
-    },
-    {
-      name: '装机',
-      nodeCode: '装载完成',
-    },
-    {
-      name: '拉下',
-      nodeCode: 'CARGOS_OFFLOAD',
-    },
-    // {
-    //   name: '退运',
-    //   nodeCode: '',
-    // },
-  ],
-  internationalArrival: [
-    {
-      name: '卸机',
-      nodeCode: 'FFM',
-    },
-    {
-      name: '机下交接',
-      nodeCode: 'CARGOS_HANDOVER_STATUS_01',
-    },
-    {
-      name: '货站交接',
-      nodeCode: 'CARGOS_HANDOVER_STATUS_99',
-    },
-    {
-      name: '理货',
-      nodeCode: 'RCF报',
-    },
-    // {
-    //   name: '快件运抵',
-    //   nodeCode: '',
-    // },
-    {
-      name: '海关放行',
-      nodeCode: 'MTREL_in',
-    },
-    {
-      name: '出库',
-      nodeCode: 'DLV报',
-    },
-  ],
-  internationalDepartureTransfer: [
-    {
-      name: '入园',
-      nodeCode: 'EPORTREL',
-    },
-    {
-      name: '海关',
-      nodeCode: 'MTREL_out',
-    },
-    {
-      name: '运抵',
-      nodeCode: 'FOH',
-    },
-    {
-      name: '安检',
-      nodeCode: 'REH',
-    },
-    {
-      name: '收运核单',
-      nodeCode: 'RCS',
-    },
-    {
-      name: '理货',
-      nodeCode: 'ACC_BUP',
-    },
-    {
-      name: '实配',
-      nodeCode: 'LS_CARGO',
-    },
-  ],
-}
-
 export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
   const isInternational = name.includes('International')
   const isTransfer = name.includes('Transfer')
 
   const computedTrackData = computed(() => {
-    // if (name !== 'DepartureWaybill') {
-    //   return unref(trackData)
-    // }
-    // return unref(trackData).reduce((prevData, currentNode) => {
-    //   if (currentNode.nodeCode === 'ACC_BUP') {
-    //     return [
-    //       ...prevData,
-    //       currentNode,
-    //       { ...currentNode, nodeCode: 'SECURITY' },
-    //     ]
-    //   }
-    //   return [...prevData, currentNode]
-    // }, [] as CommonData[])
-    return unref(trackData)
+    if (name !== 'DepartureWaybill') {
+      return unref(trackData)
+    }
+    return unref(trackData).reduce((prevData, currentNode) => {
+      if (currentNode.nodeCode === 'ACC_BUP') {
+        return [
+          ...prevData,
+          currentNode,
+          { ...currentNode, nodeCode: 'SECURITY' },
+        ]
+      }
+      return [...prevData, currentNode]
+    }, [] as CommonData[])
   })
 
   const trackAirlines = ref<TrackAirline<TrackNode | CombinedTrackNode>[]>([])
@@ -266,8 +57,8 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
           departureAirport,
           arriveAirport,
           nodeCode,
-          execPosition,
-          ConsignmentItemPackagingQuantityQuantity,
+          // execPosition,
+          // ConsignmentItemPackagingQuantityQuantity,
           execResult,
           execTime,
         }
@@ -277,15 +68,15 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
         }
         const isDeparture =
           [
-            ...trackNodesMap.departure,
-            ...trackNodesMap.internationalDeparture,
-            ...trackNodesMap.internationalDepartureTransfer,
-          ].some((node) => node.nodeCode === nodeCode) ||
+            ...NODE_CODE.departure,
+            ...NODE_CODE.internationalDeparture,
+            ...NODE_CODE.internationalDepartureTransfer,
+          ].some(node => node.nodeCode === nodeCode) ||
           (name.includes('Departure') &&
             ![
-              ...trackNodesMap.arrival,
-              ...trackNodesMap.internationalArrival,
-            ].some((node) => node.nodeCode === nodeCode))
+              ...NODE_CODE.arrival,
+              ...NODE_CODE.internationalArrival,
+            ].some(node => node.nodeCode === nodeCode))
         const airport = isDeparture
           ? String(departureAirport ?? '')
           : String(arriveAirport ?? '')
@@ -302,7 +93,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
             datetimeToTime(execTime, flightDate),
           ],
         }
-        const nodeList = trackNodesMap[
+        const nodeList = NODE_CODE[
           isTransfer
             ? 'internationalDepartureTransfer'
             : isDeparture
@@ -312,7 +103,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
             : isInternational
             ? 'internationalArrival'
             : 'arrival'
-        ].map((node) => {
+        ].map(node => {
           if (node.nodeCode === nodeCode) {
             return {
               ...node,
@@ -327,16 +118,16 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
           }
         })
         const airline = airlines.find(
-          (airline) =>
+          airline =>
             airline.flightNO === flightNO &&
             airline.flightDate === airline.flightDate
         )
         if (airline) {
           const trackAirport = airline.airports.find(
-            (trackAirport) => trackAirport.airport === airport
+            trackAirport => trackAirport.airport === airport
           )
           if (trackAirport) {
-            trackAirport.trackSteps = trackAirport.trackSteps.map((node) => {
+            trackAirport.trackSteps = trackAirport.trackSteps.map(node => {
               if (node.nodeCode === nodeCode) {
                 node = {
                   ...node,
@@ -369,7 +160,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
       },
       [] as TrackAirline[]
     )
-    trackAirlines.value = airlines.map((airline) => {
+    trackAirlines.value = airlines.map(airline => {
       const dealedAirports = airline.airports.map((airport, index) => ({
         ...airport,
         trackSteps: airport.trackSteps.reduce((prevSteps, node, i, steps) => {
@@ -378,7 +169,7 @@ export function useTrackData(name: string, trackData: MaybeRef<CommonData[]>) {
             (index > 0
               ? ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
                 steps.some(
-                  (node) =>
+                  node =>
                     ['IMP_TALLY', 'FSUDLV'].includes(node.nodeCode) &&
                     node.active
                 )