Selaa lähdekoodia

Merge branch 'dev_zyh' of United_Software/k_online_ui into dev

Jack Zhou 10 kuukautta sitten
vanhempi
commit
738f551437

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

@@ -1,4 +1,5 @@
 import { defineStore } from 'pinia'
+import { useVisitedRowState } from './visitedRow'
 
 interface UserState {
   username: string
@@ -31,6 +32,7 @@ export const useUserStore = defineStore('user', {
         localStorage.removeItem('isFirstLogin')
       }
       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-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;
   // 输入框禁用的颜色
@@ -242,6 +242,8 @@
   .el-input {
     --el-border: #eaebed;
   }
+
+  --color-vxe-table-visited-row-bg: #ff7500;
 }
 
 :root.dark {
@@ -299,7 +301,7 @@
   --color-btn-icon-bg: #3f434a;
 
   --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;
   // 滚动条
@@ -371,4 +373,5 @@
   --color-table-click-row-bg: #403631;
   --vxe-ui-input-border-color: #656f7d;
   --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 {
   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-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>
 
           <!-- 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">
               <template #header>Containers</template>
               <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 { transportationMode } from '@/components/TransportationMode'
 import { useThemeStore } from '@/stores/modules/theme'
+import { useVisitedRowState } from '@/stores/modules/visitedRow'
 
+const visitedRowState = useVisitedRowState()
 const themeStore = useThemeStore()
 const router = useRouter()
 const props = defineProps({
@@ -401,6 +403,7 @@ const handleCellDblclick = ({ row }: any) => {
     path: '/booking/detail',
     query: { a: row.__serial_no, _schemas: row._schemas, status: row.Status }
   })
+  visitedRowState.setBookingTableData(row['__serial_no'])
 }
 // 点击link字段是时
 const handleLinkClick = (row: any, column: any) => {
@@ -409,6 +412,7 @@ const handleLinkClick = (row: any, column: any) => {
       path: '/booking/detail',
       query: { a: row.__serial_no, _schemas: row._schemas, status: row.Status }
     })
+    visitedRowState.setBookingTableData(row['__serial_no'])
   } else if (column.title === 'HBL No.') {
     router.push({
       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({
   searchTableData,
   getLoadingData,
@@ -478,6 +489,7 @@ defineExpose({
       v-vloading="tableLoadingTable || tableLoadingColumn"
       :height="props.height"
       :style="{ border: 'none' }"
+      :row-class-name="handleRowClassName"
       v-bind="bookingTable"
       @cell-dblclick="handleCellDblclick"
       @checkbox-change="handleCheckboxChange"

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

@@ -9,64 +9,71 @@ const allData: any = ref({
     top: [
       {
         label: 'MAWB/MBL No.',
-        content: 'B83131200164'
+        content: ''
       },
       {
         label: 'HAWB/HBL No.',
-        content: 'ADSZXA600324',
+        content: '',
         type: 'link'
       },
       {
         label: 'Booking No.',
-        content: 'NAM1766636'
+        content: ''
       },
       {
         label: 'PO No.',
-        content: '258904-3'
+        content: ''
+      },
+      {
+        label: 'Vessel / Airline',
+        content: ''
+      },
+      {
+        label: 'Voyage / Flight',
+        content: ''
       }
     ]
   },
   businessPartners: [
     {
       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',
-      company: 'Dynarex Corp.',
-      address: '1975 LINDEN BLVD 3RD FL SUITE # 300 ELMONT',
-      phone: '+1 212 5551234'
+      company: '',
+      address: '',
+      phone: ''
     }
   ],
   packing: [
     {
       label: 'Quantity / Unit',
-      content: 'ADSZXA600324'
+      content: ''
     },
     {
       label: 'G. Weight',
-      content: 'ADSZXA600324'
+      content: ''
     },
     {
       label: 'Ch. Weight',
-      content: 'ADSZXA600324'
+      content: ''
     },
     {
       label: 'Volume',
-      content: 'ADSZXA600324'
+      content: ''
     }
   ],
   marksAndDescription: [
     {
       label: 'Marks',
-      content: 'TO: ABC COMPANY, NEW YORK, USA / PACKAGES 1/50 / FRAGILE'
+      content: ''
     },
     {
       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.',
           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 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>
     </div>
     <div class="info-content">
@@ -254,7 +259,7 @@ const openShareDialog = () => {
           </div>
 
           <!-- 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">
               <template #header>Containers</template>
               <template #content>

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

@@ -1,10 +1,7 @@
 <script setup lang="ts">
-import { useRouter } from 'vue-router'
 import XEClipboard from 'xe-clipboard'
 import AddReferenceDialog from './AddReferenceDialog.vue'
 
-const router = useRouter()
-
 const props = defineProps({
   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) => {
@@ -423,7 +416,7 @@ defineExpose({
         </div>
       </div>
     </div>
-    <AddReferenceDialog ref="addReferenceRef"></AddReferenceDialog>
+    <!-- <AddReferenceDialog ref="addReferenceRef"></AddReferenceDialog> -->
   </div>
 </template>
 

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

@@ -20,6 +20,7 @@ const themeStore = useThemeStore()
 const props = defineProps<{
   serial_no?: string
   uncode?: string
+  _schemas?: string
 }>()
 
 const markerPositions = ref([])
@@ -147,7 +148,8 @@ const getMarker = () => {
   $api
     .getTrackingDetailMapData({
       serial_no: props.serial_no,
-      uncode: props.uncode
+      uncode: props.uncode,
+      _schemas: props._schemas
     })
     .then((res) => {
       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="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')"
       >
         Shipment Status
       </div>
       <div
+        v-if="props.data?.transportInfo?.mode !== 'Air Freight'"
         class="tab"
         :class="{ 'is-active': activeName === 'containerStatus' }"
         @click="handleTabClick('containerStatus')"
       >
         Container Status
       </div>
+      <div v-else class="tab"></div>
     </div>
     <div class="content">
       <template v-if="activeName === 'shipmentStatus'">
         <ShipmentStatus :data="props.data?.simplexData" />
       </template>
-      <template v-else-if="activeName === 'containerStatus'">
+      <template
+        v-else-if="
+          activeName === 'containerStatus' && props.data?.transportInfo?.mode !== 'Air Freight'
+        "
+      >
         <ContainerStatus :data="props.data?.containerStatusData" />
       </template>
     </div>
@@ -64,6 +74,9 @@ const handleTabClick = (name: string) => {
         border-bottom: 2px solid var(--color-theme);
         color: var(--color-neutral-1);
       }
+      &.only-one-mode {
+        color: var(--color-neutral-1);
+      }
     }
   }
   .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 { useLoadingState } from '@/stores/modules/loadingState'
 import { useThemeStore } from '@/stores/modules/theme'
+import { useVisitedRowState } from '@/stores/modules/visitedRow'
 
+const visitedRowState = useVisitedRowState()
 const themeStore = useThemeStore()
 
 const router = useRouter()
@@ -480,6 +482,7 @@ const handleCellDblclick = ({ row }: any) => {
     path: '/tracking/detail',
     query: { a: row.__serial_no, _schemas: row._schemas }
   })
+  visitedRowState.setTrackingTableData(row['__serial_no'])
 }
 // 点击link字段时
 const handleLinkClick = (row: any, column: any) => {
@@ -493,6 +496,7 @@ const handleLinkClick = (row: any, column: any) => {
       path: '/tracking/detail',
       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({
   searchTableData,
   getSharedTableData,
@@ -569,6 +581,7 @@ defineExpose({
       v-vloading="tableLoadingColumn || tableLoadingTable || loadingState.trackingTableLoading"
       :height="props.height"
       :style="{ border: 'none' }"
+      :row-class-name="handleRowClassName"
       v-bind="trackingTable"
       @cell-dblclick="handleCellDblclick"
       @checkbox-change="handleCheckboxChange"