Browse Source

Merge branch 'dev_zyh' of United_Software/k_online_ui into dev

Jack Zhou 10 months ago
parent
commit
738f551437

+ 2 - 0
src/stores/modules/user.ts

@@ -1,4 +1,5 @@
 import { defineStore } from 'pinia'
 import { defineStore } from 'pinia'
+import { useVisitedRowState } from './visitedRow'
 
 
 interface UserState {
 interface UserState {
   username: string
   username: string
@@ -31,6 +32,7 @@ export const useUserStore = defineStore('user', {
         localStorage.removeItem('isFirstLogin')
         localStorage.removeItem('isFirstLogin')
       }
       }
       this.isFirstLogin = false
       this.isFirstLogin = false
+      useVisitedRowState().clearVisitedRow()
     }
     }
   }
   }
 })
 })

+ 30 - 0
src/stores/modules/visitedRow.ts

@@ -0,0 +1,30 @@
+import { defineStore } from 'pinia'
+
+interface VisitedRowState {
+  trackingTableData: Array<String>
+  bookingTableData: Array<String>
+}
+
+export const useVisitedRowState = defineStore('visitedRowState', {
+  state: (): VisitedRowState => ({
+    trackingTableData: JSON.parse(localStorage.getItem('trackingTableData')) || [],
+    bookingTableData: JSON.parse(localStorage.getItem('bookingTableData')) || []
+  }),
+  getters: {},
+  actions: {
+    setTrackingTableData(item: String) {
+      this.trackingTableData.push(item)
+      localStorage.setItem('trackingTableData', JSON.stringify(this.trackingTableData))
+    },
+    setBookingTableData(item: String) {
+      this.bookingTableData.push(item)
+      localStorage.setItem('bookingTableData', JSON.stringify(this.bookingTableData))
+    },
+    clearVisitedRow() {
+      this.trackingTableData = []
+      this.bookingTableData = []
+      localStorage.removeItem('trackingTableData')
+      localStorage.removeItem('bookingTableData')
+    }
+  }
+})

+ 5 - 2
src/styles/theme.scss

@@ -221,7 +221,7 @@
   --color-container-status-node-bg: #f8f9fd;
   --color-container-status-node-bg: #f8f9fd;
 
 
   --color-table-stripe-bg: #ffffff;
   --color-table-stripe-bg: #ffffff;
-  --color-table-row-hover-bg: #f2f2f2;
+  --color-table-row-hover-bg: rgba(255, 117, 0, 0.1);
 
 
   --color-share-link-bg: #f8f9fd;
   --color-share-link-bg: #f8f9fd;
   // 输入框禁用的颜色
   // 输入框禁用的颜色
@@ -242,6 +242,8 @@
   .el-input {
   .el-input {
     --el-border: #eaebed;
     --el-border: #eaebed;
   }
   }
+
+  --color-vxe-table-visited-row-bg: #ff7500;
 }
 }
 
 
 :root.dark {
 :root.dark {
@@ -299,7 +301,7 @@
   --color-btn-icon-bg: #3f434a;
   --color-btn-icon-bg: #3f434a;
 
 
   --color-table-stripe-bg: #2b2f36;
   --color-table-stripe-bg: #2b2f36;
-  --color-table-row-hover-bg: #3c4049;
+  --color-table-row-hover-bg: rgba(255, 117, 0, 0.1);
 
 
   --color-share-link-bg: #3a4149;
   --color-share-link-bg: #3a4149;
   // 滚动条
   // 滚动条
@@ -371,4 +373,5 @@
   --color-table-click-row-bg: #403631;
   --color-table-click-row-bg: #403631;
   --vxe-ui-input-border-color: #656f7d;
   --vxe-ui-input-border-color: #656f7d;
   --vxe-ui-table-menu-background-color: #3e454f;
   --vxe-ui-table-menu-background-color: #3e454f;
+  --color-vxe-table-visited-row-bg: #3c4149;
 }
 }

+ 3 - 0
src/styles/vxeTable.scss

@@ -23,6 +23,9 @@
 .vxe-table--render-default .vxe-body--row.row--current {
 .vxe-table--render-default .vxe-body--row.row--current {
   background-color: rgba(255, 117, 0, 0.2) !important;
   background-color: rgba(255, 117, 0, 0.2) !important;
 }
 }
+.vxe-table--render-default tr.vxe-body--row.visited-row {
+  background-color: var(--color-vxe-table-visited-row-bg) !important;
+}
 
 
 .vxe-table--render-default .vxe-body--column.col--ellipsis,
 .vxe-table--render-default .vxe-body--column.col--ellipsis,
 .vxe-table--render-default .vxe-footer--column.col--ellipsis,
 .vxe-table--render-default .vxe-footer--column.col--ellipsis,

+ 1 - 1
src/views/Booking/src/components/BookingDetail/src/BookingDetail.vue

@@ -212,7 +212,7 @@ const { isOverflow: isDestinationOverflow } = useOverflow(destinationRef, allDat
           </div>
           </div>
 
 
           <!-- Containers -->
           <!-- Containers -->
-          <div v-if="item.id === 2">
+          <div v-if="item.id === 2 && allData?.transportInfo?.mode !== 'Air Freight'">
             <VBox :id="item.id" :isSeeAll="false" @draggable="handleDraggable">
             <VBox :id="item.id" :isSeeAll="false" @draggable="handleDraggable">
               <template #header>Containers</template>
               <template #header>Containers</template>
               <template #content>
               <template #content>

+ 12 - 0
src/views/Booking/src/components/BookingTable/src/BookingTable.vue

@@ -8,7 +8,9 @@ import { ref, onMounted } from 'vue'
 import { useRouter } from 'vue-router'
 import { useRouter } from 'vue-router'
 import { transportationMode } from '@/components/TransportationMode'
 import { transportationMode } from '@/components/TransportationMode'
 import { useThemeStore } from '@/stores/modules/theme'
 import { useThemeStore } from '@/stores/modules/theme'
+import { useVisitedRowState } from '@/stores/modules/visitedRow'
 
 
+const visitedRowState = useVisitedRowState()
 const themeStore = useThemeStore()
 const themeStore = useThemeStore()
 const router = useRouter()
 const router = useRouter()
 const props = defineProps({
 const props = defineProps({
@@ -401,6 +403,7 @@ const handleCellDblclick = ({ row }: any) => {
     path: '/booking/detail',
     path: '/booking/detail',
     query: { a: row.__serial_no, _schemas: row._schemas, status: row.Status }
     query: { a: row.__serial_no, _schemas: row._schemas, status: row.Status }
   })
   })
+  visitedRowState.setBookingTableData(row['__serial_no'])
 }
 }
 // 点击link字段是时
 // 点击link字段是时
 const handleLinkClick = (row: any, column: any) => {
 const handleLinkClick = (row: any, column: any) => {
@@ -409,6 +412,7 @@ const handleLinkClick = (row: any, column: any) => {
       path: '/booking/detail',
       path: '/booking/detail',
       query: { a: row.__serial_no, _schemas: row._schemas, status: row.Status }
       query: { a: row.__serial_no, _schemas: row._schemas, status: row.Status }
     })
     })
+    visitedRowState.setBookingTableData(row['__serial_no'])
   } else if (column.title === 'HBL No.') {
   } else if (column.title === 'HBL No.') {
     router.push({
     router.push({
       path: '/tracking/detail',
       path: '/tracking/detail',
@@ -442,6 +446,13 @@ const handleTableMenuClick = () => {
   )
   )
 }
 }
 
 
+// 修改已查看详情行的样式
+const handleRowClassName = ({ row }: any) => {
+  if (visitedRowState.bookingTableData.includes(row['__serial_no'])) {
+    return 'visited-row'
+  }
+  return ''
+}
 defineExpose({
 defineExpose({
   searchTableData,
   searchTableData,
   getLoadingData,
   getLoadingData,
@@ -478,6 +489,7 @@ defineExpose({
       v-vloading="tableLoadingTable || tableLoadingColumn"
       v-vloading="tableLoadingTable || tableLoadingColumn"
       :height="props.height"
       :height="props.height"
       :style="{ border: 'none' }"
       :style="{ border: 'none' }"
+      :row-class-name="handleRowClassName"
       v-bind="bookingTable"
       v-bind="bookingTable"
       @cell-dblclick="handleCellDblclick"
       @cell-dblclick="handleCellDblclick"
       @checkbox-change="handleCheckboxChange"
       @checkbox-change="handleCheckboxChange"

+ 32 - 17
src/views/Tracking/src/components/PublicTracking/src/components/BasicInformation.vue

@@ -9,64 +9,71 @@ const allData: any = ref({
     top: [
     top: [
       {
       {
         label: 'MAWB/MBL No.',
         label: 'MAWB/MBL No.',
-        content: 'B83131200164'
+        content: ''
       },
       },
       {
       {
         label: 'HAWB/HBL No.',
         label: 'HAWB/HBL No.',
-        content: 'ADSZXA600324',
+        content: '',
         type: 'link'
         type: 'link'
       },
       },
       {
       {
         label: 'Booking No.',
         label: 'Booking No.',
-        content: 'NAM1766636'
+        content: ''
       },
       },
       {
       {
         label: 'PO No.',
         label: 'PO No.',
-        content: '258904-3'
+        content: ''
+      },
+      {
+        label: 'Vessel / Airline',
+        content: ''
+      },
+      {
+        label: 'Voyage / Flight',
+        content: ''
       }
       }
     ]
     ]
   },
   },
   businessPartners: [
   businessPartners: [
     {
     {
       title: 'Origin Agent',
       title: 'Origin Agent',
-      company: 'Dynarex Corp.',
-      address: '1975 LINDEN BLVD 3RD FL SUITE # 300 ELMONT',
-      phone: '+1 212 5551234'
+      company: '',
+      address: '',
+      phone: ''
     },
     },
     {
     {
       title: 'Destination Agent',
       title: 'Destination Agent',
-      company: 'Dynarex Corp.',
-      address: '1975 LINDEN BLVD 3RD FL SUITE # 300 ELMONT',
-      phone: '+1 212 5551234'
+      company: '',
+      address: '',
+      phone: ''
     }
     }
   ],
   ],
   packing: [
   packing: [
     {
     {
       label: 'Quantity / Unit',
       label: 'Quantity / Unit',
-      content: 'ADSZXA600324'
+      content: ''
     },
     },
     {
     {
       label: 'G. Weight',
       label: 'G. Weight',
-      content: 'ADSZXA600324'
+      content: ''
     },
     },
     {
     {
       label: 'Ch. Weight',
       label: 'Ch. Weight',
-      content: 'ADSZXA600324'
+      content: ''
     },
     },
     {
     {
       label: 'Volume',
       label: 'Volume',
-      content: 'ADSZXA600324'
+      content: ''
     }
     }
   ],
   ],
   marksAndDescription: [
   marksAndDescription: [
     {
     {
       label: 'Marks',
       label: 'Marks',
-      content: 'TO: ABC COMPANY, NEW YORK, USA / PACKAGES 1/50 / FRAGILE'
+      content: ''
     },
     },
     {
     {
       label: 'Description',
       label: 'Description',
-      content:
-        '50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE IN CHINAERAMIC VASES, GROSS WEIGHT 1000KG,50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE IN CHINA 50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE IN CHINAERAMIC VASES, GROSS WEIGHT 1000KG,50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE IN CHINA 50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE IN CHINAERAMIC VASES, GROSS WEIGHT 1000KG,50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE IN CHINA 50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE IN CHINAERAMIC VASES, GROSS WEIGHT 1000KG,50 CARTONS OF CERAMIC VASES, GROSS WEIGHT 1000KG, NET WEIGHT 950KG, MADE '
+      content: ''
     }
     }
   ]
   ]
 })
 })
@@ -89,6 +96,14 @@ const convertData = (data: any) => {
         {
         {
           label: 'PO No.',
           label: 'PO No.',
           content: data.basicInfo.PO_NO || '--'
           content: data.basicInfo.PO_NO || '--'
+        },
+        {
+          label: 'Vessel / Airline',
+          content: data.basicInfo['Vessel/Airline'] || '--'
+        },
+        {
+          label: 'Voyage / Flight',
+          content: data.basicInfo['Voyage/Filght'] || '--'
         }
         }
       ]
       ]
     },
     },

+ 7 - 2
src/views/Tracking/src/components/TrackingDetail/src/TrackingDetail.vue

@@ -213,7 +213,12 @@ const openShareDialog = () => {
       </div>
       </div>
     </div>
     </div>
     <div class="transport-map">
     <div class="transport-map">
-      <MapView style="flex: 1" :serial_no="allData?.serial_no" :uncode="allData?.uncode"></MapView>
+      <MapView
+        style="flex: 1"
+        :_schemas="allData?._schemas"
+        :serial_no="allData?.serial_no"
+        :uncode="allData?.uncode"
+      ></MapView>
       <TransportStep class="transport-step" :data="allData"></TransportStep>
       <TransportStep class="transport-step" :data="allData"></TransportStep>
     </div>
     </div>
     <div class="info-content">
     <div class="info-content">
@@ -254,7 +259,7 @@ const openShareDialog = () => {
           </div>
           </div>
 
 
           <!-- Containers -->
           <!-- Containers -->
-          <div v-if="item.id === 2">
+          <div v-if="item.id === 2 && allData?.transportInfo?.mode !== 'Air Freight'">
             <VBox :id="item.id" :isSeeAll="false" @draggable="handleDraggable">
             <VBox :id="item.id" :isSeeAll="false" @draggable="handleDraggable">
               <template #header>Containers</template>
               <template #header>Containers</template>
               <template #content>
               <template #content>

+ 1 - 8
src/views/Tracking/src/components/TrackingDetail/src/components/BasicInformation.vue

@@ -1,10 +1,7 @@
 <script setup lang="ts">
 <script setup lang="ts">
-import { useRouter } from 'vue-router'
 import XEClipboard from 'xe-clipboard'
 import XEClipboard from 'xe-clipboard'
 import AddReferenceDialog from './AddReferenceDialog.vue'
 import AddReferenceDialog from './AddReferenceDialog.vue'
 
 
-const router = useRouter()
-
 const props = defineProps({
 const props = defineProps({
   data: Object
   data: Object
 })
 })
@@ -208,10 +205,6 @@ const convertData = (data: any) => {
     ]
     ]
   }
   }
 }
 }
-// 跳转到shipment页面
-const handLink = (id: string) => {
-  router.push({ path: '/tracking', query: { id } })
-}
 
 
 // 复制文本
 // 复制文本
 const handleCopy = (data: any) => {
 const handleCopy = (data: any) => {
@@ -423,7 +416,7 @@ defineExpose({
         </div>
         </div>
       </div>
       </div>
     </div>
     </div>
-    <AddReferenceDialog ref="addReferenceRef"></AddReferenceDialog>
+    <!-- <AddReferenceDialog ref="addReferenceRef"></AddReferenceDialog> -->
   </div>
   </div>
 </template>
 </template>
 
 

+ 3 - 1
src/views/Tracking/src/components/TrackingDetail/src/components/MapView.vue

@@ -20,6 +20,7 @@ const themeStore = useThemeStore()
 const props = defineProps<{
 const props = defineProps<{
   serial_no?: string
   serial_no?: string
   uncode?: string
   uncode?: string
+  _schemas?: string
 }>()
 }>()
 
 
 const markerPositions = ref([])
 const markerPositions = ref([])
@@ -147,7 +148,8 @@ const getMarker = () => {
   $api
   $api
     .getTrackingDetailMapData({
     .getTrackingDetailMapData({
       serial_no: props.serial_no,
       serial_no: props.serial_no,
-      uncode: props.uncode
+      uncode: props.uncode,
+      _schemas: props._schemas
     })
     })
     .then((res) => {
     .then((res) => {
       if (res.code === 200) {
       if (res.code === 200) {

+ 15 - 2
src/views/Tracking/src/components/TrackingDetail/src/components/TransportStep.vue

@@ -15,24 +15,34 @@ const handleTabClick = (name: string) => {
     <div class="header">
     <div class="header">
       <div
       <div
         class="tab"
         class="tab"
-        :class="{ 'is-active': activeName === 'shipmentStatus' }"
+        :class="{
+          'is-active':
+            activeName === 'shipmentStatus' && props.data?.transportInfo?.mode !== 'Air Freight',
+          'only-one-mode': props.data?.transportInfo?.mode === 'Air Freight'
+        }"
         @click="handleTabClick('shipmentStatus')"
         @click="handleTabClick('shipmentStatus')"
       >
       >
         Shipment Status
         Shipment Status
       </div>
       </div>
       <div
       <div
+        v-if="props.data?.transportInfo?.mode !== 'Air Freight'"
         class="tab"
         class="tab"
         :class="{ 'is-active': activeName === 'containerStatus' }"
         :class="{ 'is-active': activeName === 'containerStatus' }"
         @click="handleTabClick('containerStatus')"
         @click="handleTabClick('containerStatus')"
       >
       >
         Container Status
         Container Status
       </div>
       </div>
+      <div v-else class="tab"></div>
     </div>
     </div>
     <div class="content">
     <div class="content">
       <template v-if="activeName === 'shipmentStatus'">
       <template v-if="activeName === 'shipmentStatus'">
         <ShipmentStatus :data="props.data?.simplexData" />
         <ShipmentStatus :data="props.data?.simplexData" />
       </template>
       </template>
-      <template v-else-if="activeName === 'containerStatus'">
+      <template
+        v-else-if="
+          activeName === 'containerStatus' && props.data?.transportInfo?.mode !== 'Air Freight'
+        "
+      >
         <ContainerStatus :data="props.data?.containerStatusData" />
         <ContainerStatus :data="props.data?.containerStatusData" />
       </template>
       </template>
     </div>
     </div>
@@ -64,6 +74,9 @@ const handleTabClick = (name: string) => {
         border-bottom: 2px solid var(--color-theme);
         border-bottom: 2px solid var(--color-theme);
         color: var(--color-neutral-1);
         color: var(--color-neutral-1);
       }
       }
+      &.only-one-mode {
+        color: var(--color-neutral-1);
+      }
     }
     }
   }
   }
   .content {
   .content {

+ 13 - 0
src/views/Tracking/src/components/TrackingTable/src/TrackingTable.vue

@@ -8,7 +8,9 @@ import { ref, onMounted } from 'vue'
 import { transportationMode } from '@/components/TransportationMode'
 import { transportationMode } from '@/components/TransportationMode'
 import { useLoadingState } from '@/stores/modules/loadingState'
 import { useLoadingState } from '@/stores/modules/loadingState'
 import { useThemeStore } from '@/stores/modules/theme'
 import { useThemeStore } from '@/stores/modules/theme'
+import { useVisitedRowState } from '@/stores/modules/visitedRow'
 
 
+const visitedRowState = useVisitedRowState()
 const themeStore = useThemeStore()
 const themeStore = useThemeStore()
 
 
 const router = useRouter()
 const router = useRouter()
@@ -480,6 +482,7 @@ const handleCellDblclick = ({ row }: any) => {
     path: '/tracking/detail',
     path: '/tracking/detail',
     query: { a: row.__serial_no, _schemas: row._schemas }
     query: { a: row.__serial_no, _schemas: row._schemas }
   })
   })
+  visitedRowState.setTrackingTableData(row['__serial_no'])
 }
 }
 // 点击link字段时
 // 点击link字段时
 const handleLinkClick = (row: any, column: any) => {
 const handleLinkClick = (row: any, column: any) => {
@@ -493,6 +496,7 @@ const handleLinkClick = (row: any, column: any) => {
       path: '/tracking/detail',
       path: '/tracking/detail',
       query: { a: row.__serial_no, _schemas: row._schemas }
       query: { a: row.__serial_no, _schemas: row._schemas }
     })
     })
+    visitedRowState.setTrackingTableData(row['__serial_no'])
   }
   }
 }
 }
 
 
@@ -531,6 +535,14 @@ const handleTableMenuClick = () => {
   )
   )
 }
 }
 
 
+// 修改已查看详情行的样式
+const handleRowClassName = ({ row }: any) => {
+  if (visitedRowState.trackingTableData.includes(row['__serial_no'])) {
+    return 'visited-row'
+  }
+  return ''
+}
+
 defineExpose({
 defineExpose({
   searchTableData,
   searchTableData,
   getSharedTableData,
   getSharedTableData,
@@ -569,6 +581,7 @@ defineExpose({
       v-vloading="tableLoadingColumn || tableLoadingTable || loadingState.trackingTableLoading"
       v-vloading="tableLoadingColumn || tableLoadingTable || loadingState.trackingTableLoading"
       :height="props.height"
       :height="props.height"
       :style="{ border: 'none' }"
       :style="{ border: 'none' }"
+      :row-class-name="handleRowClassName"
       v-bind="trackingTable"
       v-bind="trackingTable"
       @cell-dblclick="handleCellDblclick"
       @cell-dblclick="handleCellDblclick"
       @checkbox-change="handleCheckboxChange"
       @checkbox-change="handleCheckboxChange"