Преглед на файлове

Merge branch 'master' of http://120.26.64.82:3000/BFFE/SZYGM1.0

zhaoke преди 2 години
родител
ревизия
a21990c01c

+ 2 - 0
public/demo.js

@@ -161,6 +161,8 @@ const DATACONTENT_ID = {
   internationalArrivalFlightInfo: 1803509, // 国际进港航班基础信息
   internationalArrivalFlightWaybill: 1803510, // 国际进港航班运单
   airportNameZh: 1803517, // 机场中文名
+  departureContainerWaybill: 1803518, // 离港航班-集装器内运单
+  arrivalContainerWaybill: 1803519, // 进港航班-集装器内运单
   // 运单
   waybillInfo: 1803514, // 运单基础信息
   waybillGoods: 1803515, // 运单节点跟踪

+ 171 - 0
src/views/realTime/components/FlightView/ContainerWaybillDialog.vue

@@ -0,0 +1,171 @@
+<template>
+  <Dialog
+    :flag="flag"
+    width="1440px"
+    :msg-title="msgTitle"
+    :with-footer="false"
+    @reset-form="dialogHide"
+  >
+    <div class="dialog-content">
+      <SimpleTable
+        :data="tableData"
+        :columns="tableColumns"
+        :column-props="{ formatter }"
+      />
+    </div>
+  </Dialog>
+</template>
+
+<script setup lang="ts">
+import Dialog from '@/components/dialog/index.vue'
+import SimpleTable from '@/components/SimpleTable/index.vue'
+import { Query } from '@/api/webApi'
+import { PropType } from 'vue'
+import { CommonData, CommonTableColumn, CommonValue } from '~/common'
+
+const props = defineProps({
+  flag: {
+    type: Boolean,
+    required: true,
+  },
+  dataContent: {
+    type: Array as PropType<CommonValue[]>,
+    required: true,
+  },
+  isDeparture: {
+    type: Boolean,
+    default: true,
+  },
+})
+
+const emit = defineEmits(['update:flag'])
+
+const dialogHide = () => {
+  emit('update:flag', false)
+}
+
+const tableColumnsMap = {
+  departure: [
+    { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
+    // { columnLabel: '集装器数量', columnName: 'stowageNum', needCount: 1 },
+    {
+      columnLabel: '品名',
+      columnName: 'typeCode',
+      width: 300,
+      showOverflowTooltip: true,
+    },
+    { columnLabel: '特货信息', columnName: 'speCargoInfo' },
+    { columnLabel: '货物件数', columnName: 'luggageCount', needCount: 1 },
+    { columnLabel: '拉下件数', columnName: 'pullNum', needCount: 1 },
+    { columnLabel: '退运件数', columnName: 'returnNum', needCount: 1 },
+    { columnLabel: '最新节点', columnName: 'nodeCode' },
+    { columnLabel: '最新位置', columnName: 'execPosition' },
+    { columnLabel: '处理结果', columnName: 'execResult' },
+    { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
+  ],
+  arrival: [
+    { columnLabel: '运单号', columnName: 'stockCode', width: 120 },
+    {
+      columnLabel: '品名',
+      columnName: 'typeCode',
+      width: 300,
+      showOverflowTooltip: true,
+    },
+    { columnLabel: '特货信息', columnName: 'speCargoInfo', needCount: 1 },
+    {
+      columnLabel: '进港报文货物件数',
+      columnName: 'messageCargos_in',
+      needCount: 1,
+    },
+    {
+      columnLabel: '进港实际货物件数',
+      columnName: 'acCargos_in',
+      needCount: 1,
+    },
+    { columnLabel: '最新节点', columnName: 'nodeCode' },
+    { columnLabel: '最新位置', columnName: 'execPosition' },
+    { columnLabel: '处理结果', columnName: 'execResult' },
+    { columnLabel: '处理时间', columnName: 'execTime', width: 130 },
+  ],
+}
+
+const msgTitle = computed(() => props.dataContent.join('-'))
+
+const tableColumns = ref<CommonTableColumn[]>([])
+const getTableColumns = () => {
+  tableColumns.value = tableColumnsMap[
+    props.isDeparture ? 'departure' : 'arrival'
+  ].map(column => ({
+    columnDescribe: '',
+    dataType: '',
+    listqueryTemplateID: null,
+    needCount: null,
+    needFilters: null,
+    needGroup: null,
+    needSearch: null,
+    needShow: 1,
+    needSort: null,
+    orderNumber: null,
+    queryTemplateColumnSetID: null,
+    queryTemplateID: null,
+    ...column,
+  }))
+}
+const tableData = ref<CommonData[]>([])
+const getTableData = async () => {
+  try {
+    const {
+      code,
+      returnData: { listValues },
+      message,
+    } = await Query<CommonData>({
+      id:
+        DATACONTENT_ID[
+          `${props.isDeparture ? 'departure' : 'arrival'}ContainerWaybill`
+        ],
+      dataContent: props.dataContent,
+    })
+    if (Number(code) !== 0) {
+      throw new Error(message || '失败')
+    }
+    tableData.value = listValues.filter(
+      row =>
+        !Object.values(row).some(
+          cellValue =>
+            typeof cellValue === 'string' && cellValue.includes('undefined')
+        )
+    )
+  } catch (error) {
+    console.error(error)
+  }
+}
+const resetTable = () => {
+  tableColumns.value = []
+  tableData.value = []
+}
+
+watch(
+  () => props.flag,
+  val => {
+    resetTable()
+    if (val) {
+      getTableColumns()
+      getTableData()
+    }
+  }
+)
+
+const formatter = (row, column, cellValue, index) => {
+  if (column.property.includes('Time') && typeof cellValue === 'string') {
+    return cellValue.replace('T', '\n')
+  }
+  return String(cellValue ?? '')
+}
+</script>
+
+<style scoped lang="scss">
+.dialog-content {
+  padding: 0 22px;
+  min-height: 300px;
+}
+</style>

+ 22 - 10
src/views/realTime/components/FlightView/index.vue

@@ -30,12 +30,12 @@
     <div class="waybill-list-wrapper">
       <div class="waybill-list-header">
         <CommonSwitch v-model:flag="UTCFlag" label="开启UTC" />
-        <el-button
+        <!-- <el-button
           class="button-sqaure"
           :icon="Refresh"
           color="#ac014d"
           @click="refreshHandler"
-        />
+        /> -->
         <el-button
           class="button-sqaure"
           :icon="Download"
@@ -61,11 +61,17 @@
         />
       </div>
     </div>
+    <ContainerWaybillDialog
+      v-model:flag="dialogFlag"
+      :data-content="containerWaybillDataContent"
+      :is-departure="isDeparture"
+    />
   </div>
 </template>
 <script setup lang="ts">
 import Search from '@/components/search/index.vue'
 import { CaretRight, Download, Refresh } from '@element-plus/icons-vue'
+import ContainerWaybillDialog from './ContainerWaybillDialog.vue'
 import SimpleTable from '@/components/SimpleTable/index.vue'
 import CommonSwitch from '../../components/CommonSwitch/index.vue'
 import ColumnSet from '../../components/ColumnSet/index.vue'
@@ -75,7 +81,6 @@ import { useTableExport } from '../../hooks/useTableExport'
 import { useTableStyle } from '../../hooks/useTableStyle'
 import { useTableCellClick } from '../../hooks/useTableCellClick'
 import { useFlightInfo } from './useFlightInfo'
-import { ElMessage } from 'element-plus'
 
 const props = defineProps({
   name: {
@@ -84,6 +89,8 @@ const props = defineProps({
   },
 })
 
+const isDeparture = computed(() => props.name.includes('Departure'))
+
 const route = useRoute()
 const {
   flightNO,
@@ -126,9 +133,9 @@ const {
 
 const UTCFlag = ref(true)
 
-const refreshHandler = () => {
-  ElMessage.info('开发中')
-}
+// const refreshHandler = () => {
+//   ElMessage.info('开发中')
+// }
 
 const {
   filteredColumns: filteredWaybillColumns,
@@ -160,8 +167,13 @@ const {
   cellClass: flightWaybillCellClass,
 } = useTableStyle(`${props.name}Waybill`)
 
-const { cellClickHandler: flightContainerCellClickHandler } = useTableCellClick(
-  `${props.name}Container`
+const {
+  cellClickHandler: flightContainerCellClickHandler,
+  dialogFlag,
+  containerNO,
+} = useTableCellClick(`${props.name}Container`)
+const containerWaybillDataContent = computed(
+  () => [flightDate, flightNO, unref(containerNO)] as string[]
 )
 const { cellClickHandler: flightWaybillCellClickHandler } = useTableCellClick(
   `${props.name}Waybill`
@@ -178,8 +190,8 @@ const { cellClickHandler: flightWaybillCellClickHandler } = useTableCellClick(
     height: 345px;
     display: flex;
     .flight-info-wrapper {
-      width: 1040px;
-      flex-shrink: 0;
+      min-width: 1040px;
+      flex: 1;
       height: 100%;
       background: #410425;
       box-sizing: border-box;

+ 8 - 8
src/views/realTime/components/FlightView/useFlightInfo.ts

@@ -31,10 +31,10 @@ const flightInfoItemsMap = {
         label: '托运运单数/货物数',
         key: "concat(preLoadList,'/',preLoad)",
       },
-      {
-        label: '中转进运单/货物数',
-        key: "concat(transInList,'/',transInList)",
-      },
+      // {
+      //   label: '中转进运单/货物数',
+      //   key: "concat(transInList,'/',transInList)",
+      // },
       {
         label: '已配载集装器',
         key: 'stowage_Yes',
@@ -95,10 +95,10 @@ const flightInfoItemsMap = {
         label: '卸载运单数/货物数',
         key: "concat(unLoadPlaneList,'/',unLoadPlane)",
       },
-      {
-        label: '中转进运单/货物数',
-        key: "concat(transInList,'/',transIn)",
-      },
+      // {
+      //   label: '中转进运单/货物数',
+      //   key: "concat(transInList,'/',transIn)",
+      // },
       {
         label: '已卸载集装器',
         key: 'stowage_Yes',

+ 11 - 4
src/views/realTime/hooks/useTableCellClick.ts

@@ -4,6 +4,10 @@ import type { CellSlotProps } from '../type'
 export function useTableCellClick(tableName?: string) {
   const router = useRouter()
   const route = useRoute()
+
+  const containerNO = ref('')
+  const dialogFlag = ref(false)
+
   const cellClickHandler = (row, column, cell, event) => {
     if (tableName?.includes('FlightWaybill')) {
       switch (column.property) {
@@ -15,9 +19,9 @@ export function useTableCellClick(tableName?: string) {
             },
           })
           break
-        case 'stowageNum':
-          ElMessage.info('开发中')
-          break
+        // case 'stowageNum':
+        //   ElMessage.info('开发中')
+        //   break
         default:
           break
       }
@@ -25,7 +29,8 @@ export function useTableCellClick(tableName?: string) {
     if (tableName?.includes('FlightContainer')) {
       switch (column.property) {
         case 'stowageNo':
-          ElMessage.info('开发中')
+          containerNO.value = row.stowageNo
+          dialogFlag.value = true
           break
         default:
           break
@@ -68,5 +73,7 @@ export function useTableCellClick(tableName?: string) {
   return {
     cellClickHandler,
     cellClickHandlerV2,
+    dialogFlag,
+    containerNO
   }
 }

+ 8 - 14
src/views/realTime/hooks/useTableStyle.ts

@@ -1,11 +1,7 @@
 import { Column } from 'element-plus'
 import { CommonData, CommonTableColumn, CommonValue } from '~/common'
 
-type RowClassGetter = (param: {
-  columns: CommonTableColumn[]
-  rowData: any
-  rowIndex: number
-}) => string
+type RowClassGetter = (param: { columns: CommonTableColumn[]; rowData: any; rowIndex: number }) => string
 type CellClassGetter = (params: {
   column: Column<CommonData>
   columns: Column<CommonData>[]
@@ -42,7 +38,12 @@ export function useTableStyle(tableName?: string) {
       }
     }
     if (tableName?.includes('FlightWaybill')) {
-      if (['stockCode', 'stowageNum'].includes(column.property)) {
+      if (
+        [
+          'stockCode',
+          // 'stowageNum'
+        ].includes(column.property)
+      ) {
         classes.push('cell-click')
       }
     }
@@ -72,14 +73,7 @@ export function useTableStyle(tableName?: string) {
     return classes.join(' ')
   }
 
-  const cellClassV2: CellClassGetter = ({
-    column,
-    columns,
-    columnIndex,
-    cellData,
-    rowData,
-    rowIndex,
-  }) => {
+  const cellClassV2: CellClassGetter = ({ column, columns, columnIndex, cellData, rowData, rowIndex }) => {
     const classes: string[] = []
     // if ((['4/243', '0/6'] as any[]).includes(cellData)) {
     //   classes.push('cell-warning')

+ 2 - 6
src/views/systemSettings/warningEdit/index.vue

@@ -544,23 +544,19 @@ const getQuery = async () => {
       returnData.columnSet.forEach((item) => {
         if (item.listqueryTemplateID && item.columnName === "beginNode") {
           getSelectData(item.listqueryTemplateID, "", "beginNode");
-          // tableOptionser.value = getSelectData(item.listqueryTemplateID);
         } else if (
           item.listqueryTemplateID &&
           item.columnName === "beginPosition"
         ) {
-          getSelectData(item.listqueryTemplateID, "", "beginPosition");
-          // tableOptionbegin.value = getSelectData(item.listqueryTemplateID);
+          getSelectData(item.listqueryTemplateID, null, "beginPosition");
           beginPositionId.value = item.listqueryTemplateID;
         } else if (item.listqueryTemplateID && item.columnName === "endNode") {
           getSelectData(item.listqueryTemplateID, "", "endNode");
-          // tableOptionend.value = getSelectData(item.listqueryTemplateID);
         } else if (
           item.listqueryTemplateID &&
           item.columnName === "endPosition"
         ) {
-          getSelectData(item.listqueryTemplateID, "", "endPosition");
-          // tableOptionendPos.value = getSelectData(item.listqueryTemplateID);
+          getSelectData(item.listqueryTemplateID, null, "endPosition");
           endPositionId.value = item.listqueryTemplateID;
         }
       });

+ 6 - 6
src/views/systemSettings/warningSet/index.vue

@@ -122,9 +122,9 @@
                   <el-date-picker
                     v-model="tableForm.startDate"
                     :rows="1"
-                    type="datetime"
-                    format="YYYY-MM-DD HH:mm:ss"
-                    value-format="YYYY-MM-DD HH:mm:ss"
+                    type="date"
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
                     placeholder="选择日期时间"
                   >
                   </el-date-picker>
@@ -138,11 +138,11 @@
                   :rules="formRules.isNotNull"
                 >
                   <el-date-picker
-                    format="YYYY-MM-DD HH:mm:ss"
-                    value-format="YYYY-MM-DD HH:mm:ss"
+                    format="YYYY-MM-DD"
+                    value-format="YYYY-MM-DD"
                     v-model="tableForm.endDate"
                     :rows="1"
-                    type="datetime"
+                    type="date"
                     placeholder="选择日期时间"
                   >
                   </el-date-picker>