Browse Source

feat(搜索): 新增综合搜索页面和发货状态查询功能

yz 1 month ago
parent
commit
59c8dc8632
4 changed files with 981 additions and 152 deletions
  1. 109 0
      src/api/shipment/index.js
  2. 208 152
      src/router/views/index.js
  3. 143 0
      src/views/search/comprehensive.vue
  4. 521 0
      src/views/shipment/status-query.vue

+ 109 - 0
src/api/shipment/index.js

@@ -0,0 +1,109 @@
+// 发货状态查询API接口
+import request from '@/router/axios'
+
+/**
+ * 订单发货主表数据类型定义
+ * @typedef {Object} OrderShipmentItem
+ * @property {string} id - 主键ID
+ * @property {string} shipmentNo - 发货单号
+ * @property {number} orderId - 订单ID
+ * @property {string} orderCode - 订单编号
+ * @property {string} shipmentDate - 发货日期
+ * @property {number} carrierId - 承运商ID
+ * @property {string} carrierName - 承运商名称
+ * @property {string} trackingNo - 运单号
+ * @property {string} shippingMethod - 运输方式
+ * @property {number} shipmentStatus - 发货状态
+ * @property {number} totalPackages - 总包裹数
+ * @property {string} totalWeight - 总重量
+ * @property {string} totalVolume - 总体积
+ * @property {number} shipperId - 发货人ID
+ * @property {string} shipperName - 发货人姓名
+ */
+
+/**
+ * 发货单明细数据类型定义
+ * @typedef {Object} ShipmentItemDetail
+ * @property {string} id - 主键ID
+ * @property {number} shipmentId - 发货单ID
+ * @property {string} shipmentNo - 发货单号
+ * @property {number} orderId - 订单ID
+ * @property {number} orderItemId - 订单明细ID
+ * @property {number} itemId - 物料ID
+ * @property {string} itemCode - 物料编码
+ * @property {string} itemName - 物料名称
+ * @property {string} specs - 规格
+ * @property {string} shippedQuantity - 发货数量
+ * @property {string} packageNo - 包装号
+ * @property {string} batchNo - 批次号
+ */
+
+/**
+ * 物流跟踪信息数据类型定义
+ * @typedef {Object} ShipmentTrackingInfo
+ * @property {string} id - 主键ID
+ * @property {number} shipmentId - 发货单ID
+ * @property {string} shipmentNo - 发货单号
+ * @property {string} trackingNo - 运单号
+ * @property {string} trackingStatus - 跟踪状态
+ * @property {string} location - 位置
+ * @property {string} eventTime - 事件时间
+ * @property {string} eventDesc - 事件描述
+ * @property {number} isException - 是否异常
+ * @property {string} exceptionType - 异常类型
+ */
+
+/**
+ * 获取订单发货主表列表
+ * @param {Object} params - 查询参数
+ * @param {number} params.current - 当前页码
+ * @param {number} params.size - 每页大小
+ * @param {string} [params.shipmentNo] - 发货单号
+ * @param {string} [params.orderCode] - 订单编号
+ * @param {string} [params.carrierName] - 承运商名称
+ * @param {number} [params.shipmentStatus] - 发货状态
+ * @returns {Promise<{data: {records: OrderShipmentItem[], total: number}}>}
+ */
+export const getOrderShipmentList = (params) => {
+  return request({
+    url: '/blade-factory/api/factory/order-shipment',
+    method: 'get',
+    params
+  })
+}
+
+/**
+ * 获取发货单明细列表
+ * @param {Object} params - 查询参数
+ * @param {number} params.current - 当前页码
+ * @param {number} params.size - 每页大小
+ * @param {string} [params.shipmentNo] - 发货单号
+ * @param {string} [params.itemCode] - 物料编码
+ * @param {string} [params.itemName] - 物料名称
+ * @returns {Promise<{data: {records: ShipmentItemDetail[], total: number}}>}
+ */
+export const getShipmentItemList = (params) => {
+  return request({
+    url: '/blade-factory/api/factory/shipment-item',
+    method: 'get',
+    params
+  })
+}
+
+/**
+ * 获取物流跟踪信息列表
+ * @param {Object} params - 查询参数
+ * @param {number} params.current - 当前页码
+ * @param {number} params.size - 每页大小
+ * @param {string} [params.shipmentNo] - 发货单号
+ * @param {string} [params.trackingNo] - 运单号
+ * @param {string} [params.trackingStatus] - 跟踪状态
+ * @returns {Promise<{data: {records: ShipmentTrackingInfo[], total: number}}>}
+ */
+export const getShipmentTrackingList = (params) => {
+  return request({
+    url: '/blade-factory/api/factory/shipment-tracking',
+    method: 'get',
+    params
+  })
+}

+ 208 - 152
src/router/views/index.js

@@ -1,165 +1,221 @@
-import Layout from '@/page/index/'
+import Layout from "@/page/index/";
 
-export default [{
-    path: '/wel',
-    component: Layout,
-    redirect: '/wel/index',
-    children: [{
-        path: 'index',
-        name: '首页',
-        meta: {
-            i18n: 'dashboard',
-            keepAlive: true,
-            isAuth: false,
-        },
-        component: () =>
-            import( /* webpackChunkName: "views" */ '@/views/wel/index')
-    }, {
-        path: 'dashboard',
-        name: '控制台',
+export default [
+    {
+        path: "/wel",
+        component: Layout,
+        redirect: "/wel/index",
+        children: [
+            {
+                path: "index",
+                name: "首页",
+                meta: {
+                    i18n: "dashboard",
+                    keepAlive: true,
+                    isAuth: false
+                },
+                component: () =>
+                    import(/* webpackChunkName: "views" */ "@/views/wel/index")
+            },
+            {
+                path: "dashboard",
+                name: "控制台",
+                meta: {
+                    i18n: "dashboard",
+                    menu: false,
+                    isAuth: false
+                },
+                component: () =>
+                    import(
+                        /* webpackChunkName: "views" */ "@/views/wel/dashboard"
+                    )
+            }
+        ]
+    },
+    {
+        // 新增:公告页面路由配置
+        path: "/announcement",
+        component: Layout,
+        redirect: "/announcement/index",
         meta: {
-            i18n: 'dashboard',
-            menu: false,
-            isAuth: false,
+            title: "公告管理",
+            icon: "el-icon-bell"
         },
-        component: () =>
-            import( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
-    }]
-}, {
-    // 新增:公告页面路由配置
-    path: '/announcement',
-    component: Layout,
-    redirect: '/announcement/index',
-    meta: {
-        title: '公告管理',
-        icon: 'el-icon-bell'
+        children: [
+            {
+                path: "index",
+                name: "公告管理",
+                meta: {
+                    keepAlive: true,
+                    title: "公告管理",
+                    icon: "el-icon-document"
+                },
+                component: () =>
+                    import(
+                        /* webpackChunkName: "announcement" */ "@/views/announcement/index"
+                    )
+            },
+            {
+                path: "category",
+                name: "分类管理",
+                meta: {
+                    keepAlive: true,
+                    title: "分类管理",
+                    icon: "el-icon-folder"
+                },
+                component: () =>
+                    import(
+                        /* webpackChunkName: "announcement" */ "@/views/announcement/category"
+                    )
+            }
+        ]
     },
-    children: [{
-        path: 'index',
-        name: '公告管理',
+    {
+        path: "/order",
+        component: Layout,
+        redirect: "/order/index",
         meta: {
-            keepAlive: true,
-            title: '公告管理',
-            icon: 'el-icon-document'
+            icon: "icon-order",
+            title: "订单管理",
+            keepAlive: true
         },
-        component: () => import( /* webpackChunkName: "announcement" */ '@/views/announcement/index')
-    }, {
-        path: 'category',
-        name: '分类管理',
+        children: [
+            {
+                path: "address",
+                name: "客户地址管理",
+                component: () => import("@/views/order/address/index"),
+                meta: {
+                    keepAlive: true,
+                    isAuth: true
+                }
+            },
+            // 新增:订单管理页面路由
+            {
+                path: "index",
+                name: "订单管理",
+                component: () => import("@/views/order/order/index"),
+                meta: {
+                    keepAlive: true,
+                    isAuth: true,
+                    title: "订单管理"
+                }
+            }
+        ]
+    },
+    {
+        path: "/search",
+        component: Layout,
+        redirect: "/search/invoice",
         meta: {
-            keepAlive: true,
-            title: '分类管理',
-            icon: 'el-icon-folder'
+            icon: "el-icon-search",
+            title: "综合查询",
+            keepAlive: true
         },
-        component: () => import( /* webpackChunkName: "announcement" */ '@/views/announcement/category')
-    }]
-},
-{
-    path: '/order',
-    component: Layout,
-    redirect: '/order/index',
-    meta: {
-        icon: 'icon-order',
-        title: '订单管理',
-        keepAlive: true
+        children: [
+            {
+                path: "invoice",
+                name: "发票及开票信息查询",
+                component: () => import("@/views/order/invoice/index"),
+                meta: {
+                    keepAlive: true,
+                    isAuth: true,
+                    title: "发票及开票信息查询",
+                    icon: "el-icon-document-checked"
+                }
+            },
+            {
+                path: "comprehensive",
+                name: "ComprehensiveSearch",
+                component: () => import("@/views/search/comprehensive"),
+                meta: {
+                    keepAlive: true,
+                    isTab: true,
+                    isAuth: true
+                }
+            },
+            {
+                path: "shipment-status",
+                name: "ShipmentStatusQuery",
+                component: () => import("@/views/shipment/status-query"),
+                meta: {
+                    keepAlive: true,
+                    isTab: true,
+                    isAuth: true
+                }
+            }
+        ]
     },
-    children: [
-        {
-            path: 'address',
-            name: '客户地址管理',
-            component: () => import('@/views/order/address/index'),
-            meta: {
-                keepAlive: true,
-                isAuth: true
+    {
+        path: "/forecast",
+        component: Layout,
+        redirect: "/forecast/index",
+        children: [
+            {
+                path: "index",
+                name: "预测管理",
+                meta: {
+                    keepAlive: true,
+                    isAuth: false
+                },
+                component: () =>
+                    import(
+                        /* webpackChunkName: "views" */ "@/views/forecast/index"
+                    )
             }
-        },
-        // 新增:订单管理页面路由
-        {
-            path: 'index',
-            name: '订单管理',
-            component: () => import('@/views/order/order/index'),
-            meta: {
-                keepAlive: true,
-                isAuth: true,
-                title: '订单管理'
+        ]
+    },
+    {
+        path: "/dict-horizontal",
+        component: Layout,
+        redirect: "/dict-horizontal/index",
+        children: [
+            {
+                path: "index",
+                name: "字典管理",
+                meta: {
+                    i18n: "dict"
+                },
+                component: () =>
+                    import(
+                        /* webpackChunkName: "views" */ "@/views/util/demo/dict-horizontal"
+                    )
             }
-        }
-    ]
-},
-{
-    path: '/search',
-    component: Layout,
-    redirect: '/search/invoice',
-    meta: {
-        icon: 'el-icon-search',
-        title: '综合查询',
-        keepAlive: true
+        ]
     },
-    children: [
-        {
-            path: 'invoice',
-            name: '发票及开票信息查询',
-            component: () => import('@/views/order/invoice/index'),
-            meta: {
-                keepAlive: true,
-                isAuth: true,
-                title: '发票及开票信息查询',
-                icon: 'el-icon-document-checked'
+    {
+        path: "/dict-vertical",
+        component: Layout,
+        redirect: "/dict-vertical/index",
+        children: [
+            {
+                path: "index",
+                name: "字典管理",
+                meta: {
+                    i18n: "dict"
+                },
+                component: () =>
+                    import(
+                        /* webpackChunkName: "views" */ "@/views/util/demo/dict-vertical"
+                    )
             }
-        }
-    ]
-},
-{
-    path: '/forecast',
-    component: Layout,
-    redirect: '/forecast/index',
-    children: [{
-        path: 'index',
-        name: '预测管理',
-        meta: {
-            keepAlive: true,
-            isAuth: false
-        },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/forecast/index')
-    }]
-}, {
-    path: '/dict-horizontal',
-    component: Layout,
-    redirect: '/dict-horizontal/index',
-    children: [{
-        path: 'index',
-        name: '字典管理',
-        meta: {
-            i18n: 'dict'
-        },
-        component: () =>
-            import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-horizontal')
-    }]
-}, {
-    path: '/dict-vertical',
-    component: Layout,
-    redirect: '/dict-vertical/index',
-    children: [{
-        path: 'index',
-        name: '字典管理',
-        meta: {
-            i18n: 'dict'
-        },
-        component: () =>
-            import( /* webpackChunkName: "views" */ '@/views/util/demo/dict-vertical')
-    }]
-}, {
-    path: '/info',
-    component: Layout,
-    redirect: '/info/index',
-    children: [{
-        path: 'index',
-        name: '个人信息',
-        meta: {
-            i18n: 'info'
-        },
-        component: () => import( /* webpackChunkName: "views" */ '@/views/system/userinfo')
-    }]
-},
-]
-
+        ]
+    },
+    {
+        path: "/info",
+        component: Layout,
+        redirect: "/info/index",
+        children: [
+            {
+                path: "index",
+                name: "个人信息",
+                meta: {
+                    i18n: "info"
+                },
+                component: () =>
+                    import(
+                        /* webpackChunkName: "views" */ "@/views/system/userinfo"
+                    )
+            }
+        ]
+    }
+];

+ 143 - 0
src/views/search/comprehensive.vue

@@ -0,0 +1,143 @@
+<template>
+  <div class="comprehensive-search">
+    <basic-container>
+      <div class="search-header">
+        <h2>综合搜索</h2>
+        <p>选择您需要查询的功能模块</p>
+      </div>
+      
+      <div class="search-modules">
+        <el-row :gutter="20">
+          <el-col :span="6" v-for="module in searchModules" :key="module.key">
+            <el-card 
+              class="search-module-card" 
+              :body-style="{ padding: '20px' }"
+              @click.native="openModule(module)"
+            >
+              <div class="module-icon">
+                <i :class="module.icon"></i>
+              </div>
+              <div class="module-info">
+                <h3>{{ module.title }}</h3>
+                <p>{{ module.description }}</p>
+              </div>
+            </el-card>
+          </el-col>
+        </el-row>
+      </div>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'ComprehensiveSearch',
+  data() {
+    return {
+      searchModules: [
+        {
+          key: 'shipment-status',
+          title: '发货状态查询',
+          description: '查询订单发货状态、物流跟踪信息',
+          icon: 'el-icon-truck',
+          path: '/search/shipment-status'
+        },
+        {
+          key: 'order-query',
+          title: '订单查询',
+          description: '查询订单信息、订单状态',
+          icon: 'el-icon-document',
+          path: '/search/order-query'
+        },
+        {
+          key: 'inventory-query',
+          title: '库存查询',
+          description: '查询库存信息、库存变动',
+          icon: 'el-icon-box',
+          path: '/search/inventory-query'
+        },
+        {
+          key: 'customer-query',
+          title: '客户查询',
+          description: '查询客户信息、客户订单',
+          icon: 'el-icon-user',
+          path: '/search/customer-query'
+        }
+      ]
+    }
+  },
+  
+  methods: {
+    openModule(module) {
+      if (module.key === 'shipment-status') {
+        this.$router.push('/search/shipment-status')
+      } else {
+        this.$message.info(`${module.title}功能开发中...`)
+      }
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.comprehensive-search {
+  padding: 20px;
+}
+
+.search-header {
+  text-align: center;
+  margin-bottom: 40px;
+  
+  h2 {
+    color: #303133;
+    margin-bottom: 10px;
+  }
+  
+  p {
+    color: #909399;
+    font-size: 14px;
+  }
+}
+
+.search-modules {
+  max-width: 1200px;
+  margin: 0 auto;
+}
+
+.search-module-card {
+  cursor: pointer;
+  transition: all 0.3s;
+  margin-bottom: 20px;
+  
+  &:hover {
+    transform: translateY(-5px);
+    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
+  }
+  
+  .module-icon {
+    text-align: center;
+    margin-bottom: 15px;
+    
+    i {
+      font-size: 48px;
+      color: #409EFF;
+    }
+  }
+  
+  .module-info {
+    text-align: center;
+    
+    h3 {
+      color: #303133;
+      margin-bottom: 8px;
+      font-size: 16px;
+    }
+    
+    p {
+      color: #909399;
+      font-size: 12px;
+      line-height: 1.4;
+    }
+  }
+}
+</style>

+ 521 - 0
src/views/shipment/status-query.vue

@@ -0,0 +1,521 @@
+<template>
+  <div class="shipment-status-query">
+    <basic-container>
+      <avue-crud
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        :page.sync="page"
+        v-model="form"
+        ref="crud"
+        @search-change="searchChange"
+        @search-reset="searchReset"
+        @size-change="sizeChange"
+        @current-change="currentChange"
+        @row-click="rowClick"
+      >
+        <template slot="menuLeft">
+          <el-button
+            type="primary"
+            size="small"
+            icon="el-icon-refresh"
+            @click="onLoad"
+          >
+            刷新
+          </el-button>
+        </template>
+        
+        <!-- 发货状态列插槽 -->
+        <template slot="shipmentStatus" slot-scope="{row}">
+          <el-tag :type="getStatusType(row.shipmentStatus)">
+            {{ getStatusText(row.shipmentStatus) }}
+          </el-tag>
+        </template>
+        
+        <!-- 操作列插槽 -->
+        <template slot="menu" slot-scope="{row}">
+          <el-button
+            type="text"
+            size="small"
+            @click="viewDetails(row)"
+          >
+            查看明细
+          </el-button>
+          <el-button
+            type="text"
+            size="small"
+            @click="viewTracking(row)"
+          >
+            物流跟踪
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    
+    <!-- 发货明细对话框 -->
+    <el-dialog
+      title="发货明细"
+      :visible.sync="detailDialogVisible"
+      width="80%"
+      :close-on-click-modal="false"
+    >
+      <avue-crud
+        :option="detailOption"
+        :table-loading="detailLoading"
+        :data="detailData"
+        :page.sync="detailPage"
+        ref="detailCrud"
+        @size-change="detailSizeChange"
+        @current-change="detailCurrentChange"
+      >
+      </avue-crud>
+    </el-dialog>
+    
+    <!-- 物流跟踪对话框 -->
+    <el-dialog
+      title="物流跟踪信息"
+      :visible.sync="trackingDialogVisible"
+      width="80%"
+      :close-on-click-modal="false"
+    >
+      <avue-crud
+        :option="trackingOption"
+        :table-loading="trackingLoading"
+        :data="trackingData"
+        :page.sync="trackingPage"
+        ref="trackingCrud"
+        @size-change="trackingSizeChange"
+        @current-change="trackingCurrentChange"
+      >
+        <!-- 跟踪状态列插槽 -->
+        <template slot="trackingStatus" slot-scope="{row}">
+          <el-tag :type="getTrackingStatusType(row.trackingStatus)">
+            {{ row.trackingStatus }}
+          </el-tag>
+        </template>
+        
+        <!-- 异常状态列插槽 -->
+        <template slot="isException" slot-scope="{row}">
+          <el-tag :type="row.isException ? 'danger' : 'success'">
+            {{ row.isException ? '异常' : '正常' }}
+          </el-tag>
+        </template>
+      </avue-crud>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getOrderShipmentList, getShipmentItemList, getShipmentTrackingList } from '@/api/shipment'
+import { mapGetters } from 'vuex'
+
+export default {
+  name: 'ShipmentStatusQuery',
+  data() {
+    return {
+      form: {},
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      data: [],
+      
+      // 明细相关
+      detailDialogVisible: false,
+      detailLoading: false,
+      detailData: [],
+      detailPage: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      currentShipment: null,
+      
+      // 跟踪相关
+      trackingDialogVisible: false,
+      trackingLoading: false,
+      trackingData: [],
+      trackingPage: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+      
+      // 主表配置
+      option: {
+        height: 'auto',
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        viewBtn: true,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        column: [
+          {
+            label: '发货单号',
+            prop: 'shipmentNo',
+            search: true,
+            width: 150
+          },
+          {
+            label: '订单编号',
+            prop: 'orderCode',
+            search: true,
+            width: 150
+          },
+          {
+            label: '发货日期',
+            prop: 'shipmentDate',
+            type: 'date',
+            format: 'YYYY-MM-DD',
+            valueFormat: 'YYYY-MM-DD',
+            search: true,
+            searchRange: true,
+            width: 120
+          },
+          {
+            label: '承运商',
+            prop: 'carrierName',
+            search: true,
+            width: 120
+          },
+          {
+            label: '运单号',
+            prop: 'trackingNo',
+            search: true,
+            width: 150
+          },
+          {
+            label: '运输方式',
+            prop: 'shippingMethod',
+            width: 100
+          },
+          {
+            label: '发货状态',
+            prop: 'shipmentStatus',
+            slot: true,
+            search: true,
+            type: 'select',
+            dicData: [
+              { label: '待发货', value: 1 },
+              { label: '已发货', value: 2 },
+              { label: '运输中', value: 3 },
+              { label: '已送达', value: 4 },
+              { label: '已签收', value: 5 }
+            ],
+            width: 100
+          },
+          {
+            label: '包裹数',
+            prop: 'totalPackages',
+            width: 80
+          },
+          {
+            label: '总重量(kg)',
+            prop: 'totalWeight',
+            width: 100
+          },
+          {
+            label: '总体积(m³)',
+            prop: 'totalVolume',
+            width: 100
+          },
+          {
+            label: '发货人',
+            prop: 'shipperName',
+            width: 100
+          },
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            type: 'datetime',
+            format: 'YYYY-MM-DD HH:mm:ss',
+            width: 160
+          }
+        ]
+      },
+      
+      // 明细表配置
+      detailOption: {
+        height: 400,
+        tip: false,
+        border: true,
+        index: true,
+        menu: false,
+        addBtn: false,
+        column: [
+          {
+            label: '物料编码',
+            prop: 'itemCode',
+            width: 120
+          },
+          {
+            label: '物料名称',
+            prop: 'itemName',
+            width: 150
+          },
+          {
+            label: '规格',
+            prop: 'specs',
+            width: 120
+          },
+          {
+            label: '发货数量',
+            prop: 'shippedQuantity',
+            width: 100
+          },
+          {
+            label: '包装号',
+            prop: 'packageNo',
+            width: 120
+          },
+          {
+            label: '批次号',
+            prop: 'batchNo',
+            width: 120
+          }
+        ]
+      },
+      
+      // 跟踪表配置
+      trackingOption: {
+        height: 400,
+        tip: false,
+        border: true,
+        index: true,
+        menu: false,
+        addBtn: false,
+        column: [
+          {
+            label: '运单号',
+            prop: 'trackingNo',
+            width: 150
+          },
+          {
+            label: '跟踪状态',
+            prop: 'trackingStatus',
+            slot: true,
+            width: 100
+          },
+          {
+            label: '位置',
+            prop: 'location',
+            width: 200
+          },
+          {
+            label: '事件时间',
+            prop: 'eventTime',
+            type: 'datetime',
+            format: 'YYYY-MM-DD HH:mm:ss',
+            width: 160
+          },
+          {
+            label: '事件描述',
+            prop: 'eventDesc',
+            width: 250
+          },
+          {
+            label: '异常状态',
+            prop: 'isException',
+            slot: true,
+            width: 100
+          },
+          {
+            label: '异常类型',
+            prop: 'exceptionType',
+            width: 120
+          }
+        ]
+      }
+    }
+  },
+  
+  computed: {
+    ...mapGetters(['permission'])
+  },
+  
+  created() {
+    this.onLoad()
+  },
+  
+  methods: {
+    // 获取发货状态类型
+    getStatusType(status) {
+      const statusMap = {
+        1: 'info',     // 待发货
+        2: 'warning',  // 已发货
+        3: 'primary',  // 运输中
+        4: 'success',  // 已送达
+        5: 'success'   // 已签收
+      }
+      return statusMap[status] || 'info'
+    },
+    
+    // 获取发货状态文本
+    getStatusText(status) {
+      const statusMap = {
+        1: '待发货',
+        2: '已发货',
+        3: '运输中',
+        4: '已送达',
+        5: '已签收'
+      }
+      return statusMap[status] || '未知'
+    },
+    
+    // 获取跟踪状态类型
+    getTrackingStatusType(status) {
+      if (status.includes('运输中') || status.includes('在途')) {
+        return 'primary'
+      } else if (status.includes('已送达') || status.includes('已签收')) {
+        return 'success'
+      } else if (status.includes('异常') || status.includes('延误')) {
+        return 'danger'
+      }
+      return 'info'
+    },
+    
+    // 加载数据
+    onLoad() {
+      this.loading = true
+      getOrderShipmentList({
+        ...this.query,
+        current: this.page.currentPage,
+        size: this.page.pageSize
+      }).then(res => {
+        const data = res.data.data
+        this.data = data.records
+        this.page.total = data.total
+        this.loading = false
+      }).catch(() => {
+        this.loading = false
+      })
+    },
+    
+    // 搜索
+    searchChange(params, done) {
+      this.query = params
+      this.page.currentPage = 1
+      this.onLoad()
+      done()
+    },
+    
+    // 重置搜索
+    searchReset() {
+      this.query = {}
+      this.page.currentPage = 1
+      this.onLoad()
+    },
+    
+    // 分页大小改变
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize
+      this.onLoad()
+    },
+    
+    // 当前页改变
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage
+      this.onLoad()
+    },
+    
+    // 行点击
+    rowClick(row, column, event) {
+      this.viewDetails(row)
+    },
+    
+    // 查看明细
+    viewDetails(row) {
+      this.currentShipment = row
+      this.detailDialogVisible = true
+      this.loadShipmentDetails(row.shipmentNo)
+    },
+    
+    // 加载发货明细
+    loadShipmentDetails(shipmentNo) {
+      this.detailLoading = true
+      getShipmentItemList({
+        shipmentNo: shipmentNo,
+        current: this.detailPage.currentPage,
+        size: this.detailPage.pageSize
+      }).then(res => {
+        const data = res.data.data
+        this.detailData = data.records
+        this.detailPage.total = data.total
+        this.detailLoading = false
+      }).catch(() => {
+        this.detailLoading = false
+      })
+    },
+    
+    // 明细分页大小改变
+    detailSizeChange(pageSize) {
+      this.detailPage.pageSize = pageSize
+      this.loadShipmentDetails(this.currentShipment.shipmentNo)
+    },
+    
+    // 明细当前页改变
+    detailCurrentChange(currentPage) {
+      this.detailPage.currentPage = currentPage
+      this.loadShipmentDetails(this.currentShipment.shipmentNo)
+    },
+    
+    // 查看物流跟踪
+    viewTracking(row) {
+      this.currentShipment = row
+      this.trackingDialogVisible = true
+      this.loadTrackingInfo(row.shipmentNo)
+    },
+    
+    // 加载物流跟踪信息
+    loadTrackingInfo(shipmentNo) {
+      this.trackingLoading = true
+      getShipmentTrackingList({
+        shipmentNo: shipmentNo,
+        current: this.trackingPage.currentPage,
+        size: this.trackingPage.pageSize
+      }).then(res => {
+        const data = res.data.data
+        this.trackingData = data.records
+        this.trackingPage.total = data.total
+        this.trackingLoading = false
+      }).catch(() => {
+        this.trackingLoading = false
+      })
+    },
+    
+    // 跟踪分页大小改变
+    trackingSizeChange(pageSize) {
+      this.trackingPage.pageSize = pageSize
+      this.loadTrackingInfo(this.currentShipment.shipmentNo)
+    },
+    
+    // 跟踪当前页改变
+    trackingCurrentChange(currentPage) {
+      this.trackingPage.currentPage = currentPage
+      this.loadTrackingInfo(this.currentShipment.shipmentNo)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.shipment-status-query {
+  padding: 8px;
+}
+
+::v-deep .el-dialog__body {
+  padding: 10px 20px;
+}
+
+::v-deep .avue-crud__search .el-form-item {
+  margin-bottom: 10px;
+}
+</style>