Jelajahi Sumber

feat(营销活动): 新增营销活动管理模块

yz 1 bulan lalu
induk
melakukan
e76542a555

+ 183 - 0
src/api/order/marketing-activity.js

@@ -0,0 +1,183 @@
+import request from '@/router/axios';
+
+/**
+ * 营销活动查询参数类型定义
+ * @typedef {Object} MarketingActivityQueryParams
+ * @property {string} [activityCode] - 活动编码
+ * @property {number} [applicantType] - 申请人类型
+ * @property {string|number} [customerId] - 客户ID
+ * @property {string} [customerCode] - 客户编码
+ * @property {string} [customerName] - 客户名称
+ * @property {string} [contactName] - 联系人姓名
+ * @property {string} [contactPhone] - 联系人电话
+ * @property {string} [title] - 活动标题
+ * @property {string} [activityType] - 活动类型
+ * @property {number} [approvalStatus] - 审批状态 1-待审批 2-审批通过 3-审批拒绝
+ * @property {string} [startTimeBegin] - 开始时间范围-开始
+ * @property {string} [startTimeEnd] - 开始时间范围-结束
+ * @property {string} [endTimeBegin] - 结束时间范围-开始
+ * @property {string} [endTimeEnd] - 结束时间范围-结束
+ * @property {string} [createTimeBegin] - 创建时间范围-开始
+ * @property {string} [createTimeEnd] - 创建时间范围-结束
+ */
+
+/**
+ * 营销活动表单数据类型定义
+ * @typedef {Object} MarketingActivityForm
+ * @property {string|number} [id] - 活动ID(修改时必填)
+ * @property {string} [activityCode] - 活动编码(系统自动生成)
+ * @property {number} applicantType - 申请人类型
+ * @property {string|number} customerId - 客户ID
+ * @property {string} customerCode - 客户编码
+ * @property {string} customerName - 客户名称
+ * @property {string} contactName - 联系人姓名
+ * @property {string} contactPhone - 联系人电话
+ * @property {string} title - 活动标题
+ * @property {string} startTime - 开始时间
+ * @property {string} endTime - 结束时间
+ * @property {string} activityType - 活动类型
+ * @property {string|number} promotionPrice - 促销价格
+ * @property {string} description - 活动描述
+ * @property {number} approvalStatus - 审批状态 1-待审批 2-审批通过 3-审批拒绝
+ * @property {string} [approvalRemark] - 审批备注
+ * @property {string|number} [approverId] - 审批人ID
+ * @property {string} [approverName] - 审批人姓名
+ * @property {string} [approvalTime] - 审批时间
+ */
+
+/**
+ * 营销活动列表项类型定义
+ * @typedef {Object} MarketingActivityItem
+ * @property {string} id - 活动ID
+ * @property {string} createUser - 创建用户ID
+ * @property {string} createDept - 创建部门ID
+ * @property {string} createTime - 创建时间
+ * @property {string} updateUser - 更新用户ID
+ * @property {string} updateTime - 更新时间
+ * @property {number} status - 状态 1-正常 0-禁用
+ * @property {number} isDeleted - 是否删除 0-未删除 1-已删除
+ * @property {string} activityCode - 活动编码
+ * @property {number} applicantType - 申请人类型
+ * @property {number} customerId - 客户ID
+ * @property {string} customerCode - 客户编码
+ * @property {string} customerName - 客户名称
+ * @property {string} contactName - 联系人姓名
+ * @property {string} contactPhone - 联系人电话
+ * @property {string} title - 活动标题
+ * @property {string} startTime - 开始时间
+ * @property {string} endTime - 结束时间
+ * @property {string} activityType - 活动类型
+ * @property {string} promotionPrice - 促销价格
+ * @property {string} description - 活动描述
+ * @property {number} approvalStatus - 审批状态 1-待审批 2-审批通过 3-审批拒绝
+ * @property {string} approvalRemark - 审批备注
+ * @property {number} approverId - 审批人ID
+ * @property {string} approverName - 审批人姓名
+ * @property {string} approvalTime - 审批时间
+ */
+
+/**
+ * 审批操作参数类型定义
+ * @typedef {Object} ApprovalParams
+ * @property {string|number} id - 活动ID
+ * @property {number} approvalStatus - 审批状态 2-审批通过 3-审批拒绝
+ * @property {string} approvalRemark - 审批备注(必填)
+ */
+
+/**
+ * API响应类型定义
+ * @template T
+ * @typedef {Object} ApiResponse
+ * @property {number} code - 响应码
+ * @property {boolean} success - 是否成功
+ * @property {T} data - 响应数据
+ * @property {string} msg - 响应消息
+ */
+
+/**
+ * 分页结果类型定义
+ * @template T
+ * @typedef {Object} PageResult
+ * @property {T[]} records - 数据列表
+ * @property {number} total - 总记录数
+ * @property {number} size - 每页大小
+ * @property {number} current - 当前页码
+ * @property {number} pages - 总页数
+ * @property {Array} orders - 排序信息
+ * @property {boolean} optimizeCountSql - 是否优化count查询
+ * @property {boolean} hitCount - 是否命中count缓存
+ * @property {string|null} countId - count查询ID
+ * @property {number|null} maxLimit - 最大限制
+ * @property {boolean} searchCount - 是否查询count
+ */
+
+/**
+ * 营销活动分页查询
+ * @param {number} current - 当前页码
+ * @param {number} size - 每页大小
+ * @param {MarketingActivityQueryParams} [params] - 查询参数
+ * @returns {Promise<ApiResponse<PageResult<MarketingActivityItem>>>} 分页查询结果
+ */
+export const getList = (current, size, params = {}) => {
+  return request({
+    url: '/api/blade-factory/api/factory/marketing-activity',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size
+    }
+  })
+}
+
+/**
+ * 获取营销活动详情
+ * @param {string|number} activityId - 活动ID
+ * @returns {Promise<ApiResponse<MarketingActivityItem>>} 活动详情
+ */
+export const getDetail = (activityId) => {
+  return request({
+    url: `/api/blade-factory/api/factory/marketing-activity/${activityId}`,
+    method: 'get'
+  })
+}
+
+/**
+ * 修改营销活动(主要用于审批操作)
+ * @param {MarketingActivityForm} row - 活动数据
+ * @returns {Promise<ApiResponse<boolean>>} 修改结果
+ */
+export const update = (row) => {
+  return request({
+    url: '/api/blade-factory/api/factory/marketing-activity',
+    method: 'put',
+    data: row
+  })
+}
+
+/**
+ * 审批营销活动
+ * @param {ApprovalParams} params - 审批参数
+ * @returns {Promise<ApiResponse<boolean>>} 审批结果
+ */
+export const approve = async (params) => {
+  const { id, approvalStatus, approvalRemark } = params
+  
+  // 先获取活动详情
+  const detailRes = await getDetail(id)
+  if (!detailRes.data.success) {
+    throw new Error('获取活动详情失败')
+  }
+  
+  const activityData = detailRes.data.data
+  
+  // 构建更新数据
+  const updateData = {
+    ...activityData,
+    approvalStatus,
+    approvalRemark,
+    approvalTime: new Date().toISOString().replace('T', ' ').substring(0, 19)
+  }
+  
+  return update(updateData)
+}

+ 24 - 0
src/router/views/index.js

@@ -126,6 +126,30 @@ export default [
         ]
     },
     {
+        path: "/marketing-activity",
+        component: Layout,
+        redirect: "/marketing-activity/index",
+        meta: {
+            icon: "el-icon-star-on",
+            title: "营销活动管理",
+            keepAlive: true
+        },
+        children: [
+            {
+                path: "index",
+                name: "营销活动管理",
+                component: () =>
+                    import(/* webpackChunkName: "views" */ "@/views/order/marketing-activity/index"),
+                meta: {
+                    keepAlive: true,
+                    isAuth: true,
+                    title: "营销活动管理",
+                    icon: "el-icon-star-on"
+                }
+            }
+        ]
+    },
+    {
         path: "/claim",
         component: Layout,
         redirect: "/claim/index",

+ 764 - 0
src/views/order/marketing-activity/index.vue

@@ -0,0 +1,764 @@
+<template>
+  <basic-container>
+    <avue-crud
+      :option="option"
+      :table-loading="loading"
+      :data="data"
+      :page="page"
+      :permission="permissionList"
+      :before-open="beforeOpen"
+      v-model="form"
+      ref="crud"
+      @row-update="rowUpdate"
+      @row-save="rowSave"
+      @row-del="rowDel"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @selection-change="selectionChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @on-load="onLoad"
+    >
+      <template slot="menuLeft">
+        <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          v-if="permission.marketing_activity_delete"
+          plain
+          @click="handleDelete"
+        >
+          删除
+        </el-button>
+      </template>
+
+      <!-- 审批状态显示 -->
+      <template slot="approvalStatus" slot-scope="{row}">
+        <el-tag
+          :type="getApprovalStatusType(row.approvalStatus)"
+          size="small"
+        >
+          {{ getApprovalStatusText(row.approvalStatus) }}
+        </el-tag>
+      </template>
+
+      <!-- 活动时间范围显示 -->
+      <template slot="activityPeriod" slot-scope="{row}">
+        <div>
+          <div>{{ row.startTime }}</div>
+          <div style="color: #999; font-size: 12px;">至</div>
+          <div>{{ row.endTime }}</div>
+        </div>
+      </template>
+
+      <!-- 促销价格显示 -->
+      <template slot="promotionPrice" slot-scope="{row}">
+        <span style="color: #f56c6c; font-weight: bold;">
+          ¥{{ parseFloat(row.promotionPrice).toFixed(2) }}
+        </span>
+      </template>
+
+      <!-- 操作列 -->
+      <template slot="menu" slot-scope="{row}">
+        <el-button
+          type="text"
+          size="small"
+          icon="el-icon-view"
+          @click="handleView(row)"
+        >
+          查看
+        </el-button>
+        <el-button
+          v-if="row.approvalStatus === 1"
+          type="text"
+          size="small"
+          icon="el-icon-check"
+          style="color: #67c23a;"
+          @click="handleApprove(row, 2)"
+        >
+          通过
+        </el-button>
+        <el-button
+          v-if="row.approvalStatus === 1"
+          type="text"
+          size="small"
+          icon="el-icon-close"
+          style="color: #f56c6c;"
+          @click="handleApprove(row, 3)"
+        >
+          拒绝
+        </el-button>
+      </template>
+    </avue-crud>
+
+    <!-- 审批对话框 -->
+    <el-dialog
+      :title="approvalDialog.title"
+      :visible.sync="approvalDialog.visible"
+      width="500px"
+      append-to-body
+      @close="resetApprovalDialog"
+    >
+      <el-form
+        ref="approvalForm"
+        :model="approvalForm"
+        :rules="approvalRules"
+        label-width="100px"
+      >
+        <el-form-item label="活动标题">
+          <span>{{ approvalForm.title }}</span>
+        </el-form-item>
+        <el-form-item label="客户名称">
+          <span>{{ approvalForm.customerName }}</span>
+        </el-form-item>
+        <el-form-item label="审批结果" prop="approvalStatus">
+          <el-tag
+            :type="approvalForm.approvalStatus === 2 ? 'success' : 'danger'"
+            size="medium"
+          >
+            {{ approvalForm.approvalStatus === 2 ? '审批通过' : '审批拒绝' }}
+          </el-tag>
+        </el-form-item>
+        <el-form-item label="审批意见" prop="approvalRemark">
+          <el-input
+            v-model="approvalForm.approvalRemark"
+            type="textarea"
+            :rows="4"
+            placeholder="请输入详细的审批意见"
+            maxlength="500"
+            show-word-limit
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="approvalDialog.visible = false">取消</el-button>
+        <el-button
+          type="primary"
+          :loading="approvalDialog.loading"
+          @click="submitApproval"
+        >
+          确定
+        </el-button>
+      </div>
+    </el-dialog>
+  </basic-container>
+</template>
+
+<script>
+import { getList, getDetail, update, approve } from '@/api/order/marketing-activity'
+import { mapGetters } from 'vuex'
+
+/**
+ * 营销活动记录类型定义
+ * @typedef {Object} MarketingActivityRecord
+ * @property {string} id - 活动ID
+ * @property {string} activityCode - 活动编码
+ * @property {number} applicantType - 申请人类型
+ * @property {number} customerId - 客户ID
+ * @property {string} customerCode - 客户编码
+ * @property {string} customerName - 客户名称
+ * @property {string} contactName - 联系人姓名
+ * @property {string} contactPhone - 联系人电话
+ * @property {string} title - 活动标题
+ * @property {string} startTime - 开始时间
+ * @property {string} endTime - 结束时间
+ * @property {string} activityType - 活动类型
+ * @property {string} promotionPrice - 促销价格
+ * @property {string} description - 活动描述
+ * @property {number} approvalStatus - 审批状态
+ * @property {string} approvalRemark - 审批备注
+ * @property {number} approverId - 审批人ID
+ * @property {string} approverName - 审批人姓名
+ * @property {string} approvalTime - 审批时间
+ * @property {string} createTime - 创建时间
+ * @property {string} updateTime - 更新时间
+ */
+
+/**
+ * 营销活动查询参数类型定义
+ * @typedef {Object} MarketingActivityQueryParams
+ * @property {string} [activityCode] - 活动编码
+ * @property {string} [customerName] - 客户名称
+ * @property {string} [title] - 活动标题
+ * @property {string} [activityType] - 活动类型
+ * @property {number} [approvalStatus] - 审批状态
+ */
+
+export default {
+  data() {
+    return {
+      /**
+       * 表格数据
+       * @type {MarketingActivityRecord[]}
+       */
+      data: [],
+
+      /**
+       * 查询参数
+       * @type {MarketingActivityQueryParams}
+       */
+      query: {},
+
+      /**
+       * 表单数据
+       * @type {MarketingActivityRecord}
+       */
+      form: {},
+
+      /**
+       * 选中的数据列表
+       * @type {MarketingActivityRecord[]}
+       */
+      selectionList: [],
+
+      /**
+       * 表格加载状态
+       * @type {boolean}
+       */
+      loading: true,
+
+      /**
+       * 分页配置
+       * @type {Object}
+       */
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0
+      },
+
+      /**
+       * 审批对话框配置
+       * @type {Object}
+       */
+      approvalDialog: {
+        visible: false,
+        loading: false,
+        title: ''
+      },
+
+      /**
+       * 审批表单数据
+       * @type {Object}
+       */
+      approvalForm: {
+        id: '',
+        title: '',
+        customerName: '',
+        approvalStatus: 1,
+        approvalRemark: ''
+      },
+
+      /**
+       * 审批表单验证规则
+       * @type {Object}
+       */
+      approvalRules: {
+        approvalRemark: [
+          { required: true, message: '请输入审批意见', trigger: 'blur' },
+          { min: 5, message: '审批意见至少5个字符', trigger: 'blur' },
+          { max: 500, message: '审批意见不能超过500个字符', trigger: 'blur' }
+        ]
+      },
+
+      /**
+       * 表格配置
+       * @type {Object}
+       */
+      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: 'activityCode',
+            minWidth: 120,
+            search: true,
+            fixed: true
+          },
+          {
+            label: '活动标题',
+            prop: 'title',
+            minWidth: 200,
+            search: true,
+            overHidden: true
+          },
+          {
+            label: '客户名称',
+            prop: 'customerName',
+            minWidth: 150,
+            search: true,
+            overHidden: true
+          },
+          {
+            label: '联系人',
+            prop: 'contactName',
+            minWidth: 100,
+            overHidden: true
+          },
+          {
+            label: '联系电话',
+            prop: 'contactPhone',
+            minWidth: 120,
+            overHidden: true
+          },
+          {
+            label: '活动类型',
+            prop: 'activityType',
+            minWidth: 100,
+            search: true,
+            type: 'select',
+            dicData: [
+              { label: '促销', value: '促销' },
+              { label: '折扣', value: '折扣' },
+              { label: '满减', value: '满减' },
+              { label: '买赠', value: '买赠' },
+              { label: '其他', value: '其他' }
+            ]
+          },
+          {
+            label: '活动时间',
+            prop: 'activityPeriod',
+            minWidth: 180,
+            slot: true,
+            sortable: false,
+            search: false
+          },
+          {
+            label: '促销价格',
+            prop: 'promotionPrice',
+            minWidth: 120,
+            slot: true,
+            sortable: true
+          },
+          {
+            label: '审批状态',
+            prop: 'approvalStatus',
+            minWidth: 100,
+            slot: true,
+            search: true,
+            type: 'select',
+            dicData: [
+              { label: '待审批', value: 1 },
+              { label: '审批通过', value: 2 },
+              { label: '审批拒绝', value: 3 }
+            ]
+          },
+          {
+            label: '审批人',
+            prop: 'approverName',
+            minWidth: 100,
+            overHidden: true
+          },
+          {
+            label: '审批时间',
+            prop: 'approvalTime',
+            minWidth: 150,
+            type: 'datetime',
+            format: 'yyyy-MM-dd HH:mm:ss',
+            valueFormat: 'yyyy-MM-dd HH:mm:ss'
+          },
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            minWidth: 150,
+            type: 'datetime',
+            format: 'yyyy-MM-dd HH:mm:ss',
+            valueFormat: 'yyyy-MM-dd HH:mm:ss',
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: true
+          },
+          {
+            label: '更新时间',
+            prop: 'updateTime',
+            minWidth: 150,
+            type: 'datetime',
+            format: 'yyyy-MM-dd HH:mm:ss',
+            valueFormat: 'yyyy-MM-dd HH:mm:ss',
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: true
+          },
+          {
+            label: '活动描述',
+            prop: 'description',
+            minWidth: 200,
+            type: 'textarea',
+            overHidden: true,
+            span: 24,
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: true
+          },
+          {
+            label: '审批备注',
+            prop: 'approvalRemark',
+            minWidth: 200,
+            type: 'textarea',
+            overHidden: true,
+            span: 24,
+            addDisplay: false,
+            editDisplay: false,
+            viewDisplay: true
+          }
+        ]
+      },
+
+      /**
+       * 权限列表
+       * @type {Object}
+       */
+      permissionList: {
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false
+      }
+    }
+  },
+
+  computed: {
+    ...mapGetters(['permission']),
+
+    /**
+     * 选中的ID列表
+     * @returns {string} 逗号分隔的ID字符串
+     */
+    ids() {
+      const ids = []
+      this.selectionList.forEach(ele => {
+        ids.push(ele.id)
+      })
+      return ids.join(',')
+    }
+  },
+
+  methods: {
+    /**
+     * 获取审批状态文本
+     * @param {number} status - 审批状态
+     * @returns {string} 状态文本
+     */
+    getApprovalStatusText(status) {
+      const statusMap = {
+        1: '待审批',
+        2: '审批通过',
+        3: '审批拒绝'
+      }
+      return statusMap[status] || '未知状态'
+    },
+
+    /**
+     * 获取审批状态标签类型
+     * @param {number} status - 审批状态
+     * @returns {string} 标签类型
+     */
+    getApprovalStatusType(status) {
+      const typeMap = {
+        1: 'warning',
+        2: 'success',
+        3: 'danger'
+      }
+      return typeMap[status] || 'info'
+    },
+
+    /**
+     * 查看详情
+     * @param {MarketingActivityRecord} row - 行数据
+     * @returns {void}
+     */
+    handleView(row) {
+      this.$refs.crud.rowView(row)
+    },
+
+    /**
+     * 处理审批操作
+     * @param {MarketingActivityRecord} row - 行数据
+     * @param {number} approvalStatus - 审批状态 2-通过 3-拒绝
+     * @returns {void}
+     */
+    handleApprove(row, approvalStatus) {
+      this.approvalForm = {
+        id: row.id,
+        title: row.title,
+        customerName: row.customerName,
+        approvalStatus,
+        approvalRemark: ''
+      }
+
+      this.approvalDialog.title = approvalStatus === 2 ? '审批通过' : '审批拒绝'
+      this.approvalDialog.visible = true
+    },
+
+    /**
+     * 提交审批
+     * @returns {Promise<void>}
+     */
+    async submitApproval() {
+      try {
+        await this.$refs.approvalForm.validate()
+
+        this.approvalDialog.loading = true
+
+        await approve({
+          id: this.approvalForm.id,
+          approvalStatus: this.approvalForm.approvalStatus,
+          approvalRemark: this.approvalForm.approvalRemark
+        })
+
+        this.$message.success('审批操作成功')
+        this.approvalDialog.visible = false
+        await this.onLoad(this.page)
+      } catch (error) {
+        if (error !== false) { // 表单验证失败时不显示错误
+          console.error('审批操作失败:', error)
+          this.$message.error('审批操作失败,请稍后重试')
+        }
+      } finally {
+        this.approvalDialog.loading = false
+      }
+    },
+
+    /**
+     * 重置审批对话框
+     * @returns {void}
+     */
+    resetApprovalDialog() {
+      this.approvalForm = {
+        id: '',
+        title: '',
+        customerName: '',
+        approvalStatus: 1,
+        approvalRemark: ''
+      }
+
+      if (this.$refs.approvalForm) {
+        this.$refs.approvalForm.resetFields()
+      }
+    },
+
+    /**
+     * 新增、编辑、查看前的回调
+     * @param {Function} done - 完成回调
+     * @param {string} type - 操作类型
+     * @returns {Promise<void>}
+     */
+    async beforeOpen(done, type) {
+      if (['edit', 'view'].includes(type)) {
+        try {
+          const res = await getDetail(this.form.id)
+          this.form = res.data.data
+        } catch (error) {
+          console.error('获取详情失败:', error)
+          this.$message.error('获取详情失败')
+        }
+      }
+      done()
+    },
+
+    /**
+     * 删除操作
+     * @param {MarketingActivityRecord} row - 行数据
+     * @returns {Promise<void>}
+     */
+    async rowDel(row) {
+      try {
+        await this.$confirm('确定将选择数据删除?', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+        // 注意:根据接口文档,没有删除接口,这里可能需要调用状态更新
+        this.$message.warning('删除功能暂未开放')
+      } catch (error) {
+        console.error('删除失败:', error)
+      }
+    },
+
+    /**
+     * 批量删除
+     * @returns {Promise<void>}
+     */
+    async handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning('请选择至少一条数据')
+        return
+      }
+
+      try {
+        await this.$confirm('确定将选择数据删除?', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+        // 注意:根据接口文档,没有删除接口,这里可能需要调用状态更新
+        this.$message.warning('删除功能暂未开放')
+      } catch (error) {
+        console.error('批量删除失败:', error)
+      }
+    },
+
+    /**
+     * 更新操作
+     * @param {MarketingActivityRecord} row - 行数据
+     * @param {number} index - 行索引
+     * @param {Function} done - 完成回调
+     * @param {Function} loading - 加载状态回调
+     * @returns {Promise<void>}
+     */
+    async rowUpdate(row, index, done, loading) {
+      try {
+        loading()
+        await update(row)
+        done()
+        this.$message.success('操作成功')
+        await this.onLoad(this.page)
+      } catch (error) {
+        loading()
+        console.error('更新失败:', error)
+        this.$message.error('操作失败')
+      }
+    },
+
+    /**
+     * 新增操作
+     * @param {MarketingActivityRecord} row - 行数据
+     * @param {Function} done - 完成回调
+     * @param {Function} loading - 加载状态回调
+     * @returns {Promise<void>}
+     */
+    async rowSave(row, done, loading) {
+      // 根据接口文档,没有新增接口,这里暂不实现
+      loading()
+      this.$message.warning('新增功能暂未开放')
+      done()
+    },
+
+    /**
+     * 搜索回调
+     * @param {MarketingActivityQueryParams} params - 搜索参数
+     * @param {Function} done - 完成回调
+     * @returns {void}
+     */
+    searchChange(params, done) {
+      this.query = params
+      this.page.currentPage = 1
+      this.onLoad(this.page)
+      done()
+    },
+
+    /**
+     * 搜索重置回调
+     * @returns {void}
+     */
+    searchReset() {
+      this.query = {}
+      this.page.currentPage = 1
+      this.onLoad(this.page)
+    },
+
+    /**
+     * 选择改变回调
+     * @param {MarketingActivityRecord[]} list - 选中的数据列表
+     * @returns {void}
+     */
+    selectionChange(list) {
+      this.selectionList = list
+    },
+
+    /**
+     * 清空选择回调
+     * @returns {void}
+     */
+    selectionClear() {
+      this.selectionList = []
+      this.$refs.crud.toggleSelection()
+    },
+
+    /**
+     * 当前页改变回调
+     * @param {number} currentPage - 当前页码
+     * @returns {void}
+     */
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage
+    },
+
+    /**
+     * 页大小改变回调
+     * @param {number} pageSize - 页大小
+     * @returns {void}
+     */
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize
+    },
+
+    /**
+     * 刷新回调
+     * @returns {void}
+     */
+    refreshChange() {
+      this.onLoad(this.page)
+    },
+
+    /**
+     * 数据加载
+     * @param {Object} page - 分页参数
+     * @param {Object} [params] - 查询参数
+     * @returns {Promise<void>}
+     */
+    async onLoad(page, params) {
+      this.loading = true
+      try {
+        const response = await getList(
+          page.currentPage || 1,
+          page.pageSize || 10,
+          Object.assign(params || {}, this.query)
+        )
+
+        if (response.data && response.data.success) {
+          const data = response.data.data
+          this.data = data.records || []
+          this.page.total = data.total || 0
+        } else {
+          this.data = []
+          this.page.total = 0
+          this.$message.warning('获取数据失败')
+        }
+      } catch (error) {
+        this.data = []
+        this.page.total = 0
+        console.error('加载数据失败:', error)
+        this.$message.error('加载数据失败,请稍后重试')
+      } finally {
+        this.loading = false
+      }
+    }
+  },
+
+  /**
+   * 组件挂载后初始化
+   * @returns {void}
+   */
+  mounted() {
+    this.onLoad(this.page)
+  }
+}
+</script>
+
+<style scoped>
+.dialog-footer {
+  text-align: right;
+}
+</style>