changhaoning 2 лет назад
Родитель
Сommit
ad0ad5c158

+ 21 - 0
src/api/pages/mst/activity-item.js

@@ -0,0 +1,21 @@
+/**
+ * @desc   : 市场活动明细服务
+ * @author : 常皓宁
+ * @date   : 2024/4/12 9:44
+ */
+export default {
+  activityItemService:{
+    prefix: '/mdm-server/mst/activityItem/',
+    updateItem:'updateItem'
+  }
+}
+
+/**
+ * @desc   : 市场活动明细路由
+ * @author : 常皓宁
+ * @date   : 2024/4/12 9:45
+ */
+export const routeUrl = {
+  activityItem:{
+  }
+}

+ 32 - 0
src/api/pages/mst/activity.js

@@ -0,0 +1,32 @@
+/**
+* @desc   : 市场活动服务
+* @author : 常皓宁
+* @date   : 2024/4/12 9:44
+*/
+export default {
+  activityService:{
+    prefix: '/mdm-server/mst/activity/',
+    //发布
+    release:'release',
+    //下架
+    shelves:'shelves',
+  }
+}
+
+/**
+* @desc   : 市场活动路由
+* @author : 常皓宁
+* @date   : 2024/4/12 9:45
+*/
+export const routeUrl = {
+  activity:{
+    //发布
+    release: {key: 'release', method: 'release'},
+    //下架
+    shelves: {key: 'shelves', method: 'shelves'},
+    //新建明细
+    addItem: {key: 'addItem', method: 'addItem'},
+    //编辑明细
+    editItem: {key: 'editItem', method: 'editItem'},
+  }
+}

+ 53 - 1
src/components/business/select-magnifier/setting.js

@@ -303,7 +303,59 @@ const data = {
       {field: 'whCode', width: 'auto'},
       {field: 'whName', width: 'auto'},
     ],
-  }
+  },
+  // 版本功能
+  activityFunId:{
+    // 接口文件
+    serviceStr: 'commonService',
+    // 下拉的查询方法
+    methodsName: 'getFunction',
+    // 放大镜查询方法
+    methodsNameDetail: 'getFunctionByPage',
+    // 查询条件
+    searchContent: [
+
+    ],
+    // 查询条件一行个数
+    colCount: 2,
+    // 弹窗的宽度
+    modalWidth: 550,
+    // 列表主键Id
+    selectKey: 'funUuid',
+    // 列表主键名称
+    selectLabel: 'menuName',
+    // 列表列
+    columns: [
+      {field: 'menuName', width: 'auto'},
+      {field: 'parentMenuName', width: 'auto'},
+    ],
+  },
+  // 公司
+  company:{
+    // 接口文件
+    serviceStr: 'commonService',
+    // 下拉的查询方法
+    methodsName: 'getCompany',
+    // 放大镜查询方法
+    methodsNameDetail: 'getCompanyByPage',
+    // 查询条件
+    searchContent: [
+
+    ],
+    // 查询条件一行个数
+    colCount: 2,
+    // 弹窗的宽度
+    modalWidth: 550,
+    // 列表主键Id
+    selectKey: 'cpId',
+    // 列表主键名称
+    selectLabel: 'cpName',
+    // 列表列
+    columns: [
+      {field: 'cpCode', width: 'auto'},
+      {field: 'cpName', width: 'auto'},
+    ],
+  },
 }
 
 

+ 7 - 1
src/config/index.js

@@ -319,6 +319,8 @@ export default {
     income:'t_mac_other_receivable',
     // 其他支出单
     outlay:'t_mac_other_payable',
+    // 市场活动
+    activity:'t_mst_activity',
   },
   /**
    *   @desc   : 在产盘点盘点状态
@@ -386,6 +388,8 @@ export default {
     freezeStatus: '冻结状态',
     checkStatus: '盘点状态',
     transferType: '调整状态',
+    activityType: '活动分类',
+    activityStatus: '活动状态',
   },
 
   /**
@@ -633,7 +637,9 @@ export default {
     //供应商与对象
     supplierAndCustomer: 'supplierAndCustomer',
     //组织机构
-    organization: 'organization'
+    organization: 'organization',
+    // 版本功能
+    activityFunId: 'activityFunId',
   },
   /**
    * @desc   : 收款完成

+ 20 - 0
src/locale/lang/zh-CN.js

@@ -524,6 +524,24 @@ export const columns = {
   amtPay:'付款金额',
   sumAmtPay:'付款合计金额',
   yuLan:'预览',
+  activityName:'活动名称',
+  activityDescribe:'活动描述',
+  activityTypeName:'活动分类',
+  activityStatusName:'活动状态',
+  beginDate:'开始日期',
+  endDate:'截止日期',
+  activityPath:'图片路径',
+  activityUrl:'跳转链接',
+  activityGradeCode:'活动版本',
+  activityFunId:'活动功能',
+  activityBanner:'活动广告',
+  funName:'功能',
+  itemDescribe:'明细描述',
+  stdPrice:'标准价',
+  salePrice:'销售价',
+  validLong:'时长',
+  extraLong:'赠送时长',
+  cpIds:'投放企业',
 }
 
 /**
@@ -614,6 +632,8 @@ export const messages = {
   W_112: '系统自动办理参数开启,已付款单据不能作废',
   W_113: '当前单据为手动办理,无法进行此操作',
   W_114: '当前单据为自动办理,无法进行此操作',
+  W_115: '发布状态的活动不允许再进行发布',
+  W_116: '未发布发布状态的活动不允许再进行下架',
   E_001: '系统出现异常,请联系管理员。',
   Q_001: '当前页面的数据有过更改,请确认需要保存吗?',
   Q_002: '确定要进行{param}操作吗?',

+ 699 - 0
src/view/mst/activity/index.vue

@@ -0,0 +1,699 @@
+<!-- @desc:市场活动  @auth:常皓宁  @time:2024-04-12 9:47 -->
+<template>
+  <div class="main-div" ref="mainDiv">
+    <loading :loading="loading" v-if="!modalVisible"></loading>
+    <BaseIndexButtonGroup ref="BaseIndexButtonGroup" id="BaseIndexButtonGroup">
+      <template #left>
+        <BaseIndexButton ref="search" name="search"></BaseIndexButton>
+        <BaseIndexButton ref="clear" name="clear"></BaseIndexButton>
+        <BaseIndexButton ref="edit" name="edit"></BaseIndexButton>
+        <BaseIndexButton ref="editItem" name="editItem"></BaseIndexButton>
+        <BaseIndexButton ref="release" name="release"></BaseIndexButton>
+        <BaseIndexButton ref="shelves" name="shelves"></BaseIndexButton>
+        <BaseIndexButton ref="add" name="add"></BaseIndexButton>
+        <BaseIndexButton ref="addItem" name="addItem"></BaseIndexButton>
+      </template>
+      <template #right>
+
+      </template>
+    </BaseIndexButtonGroup>
+
+    <!--  查询条件区域  -->
+    <div id="search-cond-div" ref="search-cond-div" class="search-cond-class">
+      <SearchCond ref="searchCond" v-model="searchCond"
+                  @collapse-change="collapseChange" :setFlag="false"
+                  :searchContent="searchContent"
+      ></SearchCond>
+    </div>
+    <!--  表格部分  -->
+    <DkSplit mode="vertical" v-model="split" :height="tableHeight">
+      <div slot="top" style="margin-left: 5px;">
+        <DkTable ref="table-select" name="table" :data="tableData" primaryKey="activityId"
+                 @pageChange="pageSizeChange"
+                 :page-total="pageInfo.total"
+                 :page-size="pageInfo.pageSize"
+                 :page-size-opts="pageSizeOpts"
+                 :current-page="pageInfo.currentPage"
+                 :choose-flag="false"
+                 @current-change="currentChange($event)"
+                 :height="this.tableHeight * split - 35" showFooter>
+          <DkTableColumn field="activityName"></DkTableColumn>
+          <DkTableColumn field="activityDescribe"></DkTableColumn>
+          <DkTableColumn field="activityTypeName"/>
+          <DkTableColumn field="activityStatusName"/>
+          <DkTableColumn field="beginDate" :dataType="$config.columnType.date"></DkTableColumn>
+          <DkTableColumn field="endDate" :dataType="$config.columnType.date"></DkTableColumn>
+          <DkTableColumn field="flgValid" type="switch"/>
+          <DkTableColumn field="remarks"></DkTableColumn>
+        </DkTable>
+      </div>
+      <div slot="bottom">
+        <DkTable :id="'table-'+$options.name" ref="detail-select" :data="tableDataDetail_activityItem" showFooter
+                 :choose-flag="false"
+                 :height="this.tableHeight * (1-split)" primaryKey="itemId" name="table">
+          <DkTableColumn field="itemDescribe"></DkTableColumn>
+          <DkTableColumn field="stdPrice"  data-type="number" :digits="2"></DkTableColumn>
+          <DkTableColumn field="salePrice" data-type="number" :digits="2"></DkTableColumn>
+          <DkTableColumn field="validLong"></DkTableColumn>
+          <DkTableColumn field="extraLong"></DkTableColumn>
+        </DkTable>
+      </div>
+    </DkSplit>
+
+    <!--新建编辑总单-->
+    <DkModal
+      :loading="loading"
+      v-model="editAddModal"
+      ref="modal_editAdd"
+      @on-visible-change="handleVisibleModal"
+      @modalOk="save"
+      :saveFlag="true"
+      :title="modalTitle"
+    >
+      <DkForm ref="formInline" v-model="formData" :col-count="1">
+        <!--活动名称-->
+        <DkFormItem prop="activityName" :required="true">
+          <InputPop v-model="formData.activityName"/>
+        </DkFormItem>
+        <!--活动描述-->
+        <DkFormItem prop="activityDescribe">
+          <InputPop v-model="formData.activityDescribe" :textareaFlag="true"/>
+        </DkFormItem>
+        <!--活动分类-->
+        <DkFormItem prop="activityType" :label="$t('activityTypeName')" :required="true">
+          <SelectPop v-model="formData.activityType" ref="activityType"
+                     :options="typeList"
+                     :multiple="false"
+                     labelKey="kindName" valueKey="kindCode"
+                     @on-select-label="handleGrade">
+          </SelectPop>
+        </DkFormItem>
+        <!--活动状态-->
+        <DkFormItem prop="activityStatus" :label="$t('activityStatusName')" :required="true">
+          <SelectPop v-model="formData.activityStatus" ref="activityStatus"
+                     :options="statusList"
+                     :multiple="false"
+                     labelKey="kindName" valueKey="kindCode">
+          </SelectPop>
+        </DkFormItem>
+        <!--活动版本-->
+        <DkFormItem prop="gradeCode" :label="$t('activityGradeCode')" :required="true" v-if="gradeFlag">
+          <SelectPop v-model="formData.gradeCode" ref="gradeCode"
+                     :options="gradeList"
+                     :multiple="false"
+                     labelKey="gradeName" valueKey="gradeCode">
+          </SelectPop>
+        </DkFormItem>
+        <!--活动功能-->
+        <DkFormItem prop="funId" :label="$t('activityFunId')" :required="true" v-if="funFlag">
+          <SelectMagnifier v-model="formData.funId" :display-text="formData.funName"
+                           :type="this.$config.MagnifierType.activityFunId"
+                           :multiple="false"
+                           @ok="funIdOk"/>
+        </DkFormItem>
+        <!--图片路径-->
+        <DkFormItem prop="activityPath" :label="$t('activityBanner')" :required="true" v-if="bannerFlag">
+          <DkPicWall v-model="formData.activityPath"
+                     :table="$config.tables.activity" :accept="$config.uploadFileConfig.acceptPicType"></DkPicWall>
+        </DkFormItem>
+        <!--跳转链接-->
+        <DkFormItem prop="activityUrl" :required="true" v-if="bannerFlag">
+          <InputPop v-model="formData.activityUrl"/>
+        </DkFormItem>
+        <!--开始日期-->
+        <DkFormItem prop="beginDate" :required="true" :data-type="$config.dataType.date">
+          <DatePickerPop v-model="formData.beginDate"
+                         :placeholder="$t('inputWords',{'search-name':$t('beginDate')})"
+                         type="date" :short-cut-flag="true"/>
+        </DkFormItem>
+        <!--截止日期-->
+        <DkFormItem prop="endDate" :data-type="$config.dataType.date">
+          <DatePickerPop v-model="formData.endDate"
+                         :placeholder="$t('inputWords',{'search-name':$t('endDate')})"
+                         type="date" :short-cut-flag="true"/>
+        </DkFormItem>
+        <!--投放企业-->
+        <DkFormItem prop="cpIds">
+          <SelectMagnifier v-model="formData.cpIds" :display-text="formData.cpName"
+                           :type="this.$config.MagnifierType.company"/>
+        </DkFormItem>
+      </DkForm>
+    </DkModal>
+
+    <!--新建编辑明细-->
+    <DkModal v-model="itemModal" :title="$t('activityItem')" width="800px"
+             ref="model_item"
+             @on-cancel="cancelMeasure"
+             @modalOk="submitMeasure"
+             @modalCancel="cancelMeasure"
+             :saveFlag="true">
+      <DkCollapse ref="collapse">
+        <DkPanel prop="活动总单">
+          <DkForm slot="content" ref="formMeasure" style="width:100%;" name="dk-form" v-model="totalForm" :col-count="3">
+            <!--活动名称-->
+            <DkFormItem prop="activityName">
+              <InputPop v-model="totalForm.activityName" :readonly="true"/>
+            </DkFormItem>
+            <!--开始日期-->
+            <DkFormItem prop="beginDate" :data-type="$config.dataType.date">
+              <DatePickerPop v-model="totalForm.beginDate"
+                             :placeholder="$t('inputWords',{'search-name':$t('beginDate')})"
+                             :readonly="true"
+                             type="date" :short-cut-flag="true"/>
+            </DkFormItem>
+            <!--截止日期-->
+            <DkFormItem prop="endDate" :data-type="$config.dataType.date">
+              <DatePickerPop v-model="totalForm.endDate"
+                             :placeholder="$t('inputWords',{'search-name':$t('endDate')})"
+                             :readonly="true"
+                             type="date" :short-cut-flag="true"/>
+            </DkFormItem>
+            <!--活动描述-->
+            <DkFormItem prop="activityDescribe">
+              <InputPop v-model="totalForm.activityDescribe" :readonly="true" textarea-flag/>
+            </DkFormItem>
+          </DkForm>
+        </DkPanel>
+        <DkPanel prop="活动明细">
+          <!--  下拉区域  -->
+          <DkForm slot="content" ref="formInline" v-model="itemForm" style="width: 100%" :labelMaxWords="7"
+                  :col-count="1">
+            <div v-for="(item,index) of itemForm.itemList" :key="index" style="width: 100%;margin:25px 35px">
+              <DkFormItem prop="itemDescribe"  :required="true">
+                <InputPop v-model="item.itemDescribe"/>
+              </DkFormItem>
+              <DkFormItem prop="stdPrice"  :required="true" data-type="number">
+                <InputNumberPop v-model="item.stdPrice"/>
+              </DkFormItem>
+              <DkFormItem prop="salePrice"  :required="true" data-type="number">
+                <InputNumberPop v-model="item.salePrice"/>
+              </DkFormItem>
+              <DkFormItem prop="validLong"  :required="true" data-type="number">
+                <InputNumberPop v-model="item.validLong" :unit="'天'"/>
+              </DkFormItem>
+              <DkFormItem prop="extraLong"  :required="true" data-type="number">
+                <InputNumberPop v-model="item.extraLong" :unit="'天'"/>
+              </DkFormItem>
+            </div>
+            <Button @click="addNewItem" icon="md-add" long style="margin-top: 10px;margin-left: 20px"></Button>
+          </DkForm>
+        </DkPanel>
+      </DkCollapse>
+    </DkModal>
+  </div>
+</template>
+
+<script>
+import {indexMixin} from '@/mixins'
+
+export default {
+  name: "activity",
+  mixins: [indexMixin],
+  data() {
+    let self = this
+    return {
+      typeList:[],//活动分类
+      statusList:[],//活动状态
+      gradeList:[],//版本代码
+      gradeFlag:false,//活动版本显示标识
+      funFlag:false,//活动功能显示标识
+      bannerFlag:false,//活动广告显示标识
+      itemModal:false,
+      itembutton:null,
+      tableData: [],
+      tableDataDetail_activityItem: [],
+      formData:{
+        activityId: null,
+        activityName: null,
+        activityDescribe:null,
+        activityType:null,
+        activityStatus:null,
+        beginDate:null,
+        endDate:null,
+        flgBanner:false,
+        activityPath:'{}' ,
+        activityUrl:null,
+        gradeCode:null,
+        funId:null,
+        funName:null,
+        appCode:null,
+        cpIds:null,
+      },
+      //总单
+      totalForm:{
+        activityId: null,
+        activityName: null,
+        activityDescribe:null,
+        activityType:null,
+        activityStatus:null,
+        beginDate:null,
+        endDate:null,
+        flgBanner:false,
+        activityPath:'{}',
+        activityUrl:null,
+        gradeCode:null,
+        funId:null,
+        funName:null,
+        appCode:null,
+        cpIds:null,
+      },
+      //明细
+      itemForm:{
+        activityId:null,
+        itemList:[{
+          itemId:null,
+          itemDescribe:null,
+          stdPrice:null,
+          salePrice:null,
+          validLong:null,
+          extraLong:null,
+        }]
+      },
+      searchContent: [
+        {
+          itemCode: '转账单号-文本',
+          itemName: 'activityName',
+          valueFormat: {code: 'activityName'},
+          valueKind: 'STR'
+        },
+      ],
+    }
+  },
+  methods: {
+    /**
+    * @desc   : 添加明细
+    * @author : 常皓宁
+    * @date   : 2024/4/16 8:57
+    */
+    addNewItem() {
+      this.itemForm.itemList.push({"itemId":null,"itemDescribe": null, "stdPrice": null, "salePrice": null,"validLong":null,"extraLong":null})
+    },
+    /**
+    * @desc   : 取消
+    * @author : 常皓宁
+    * @date   : 2024/4/16 8:50
+    */
+    cancelMeasure() {
+      this.measureModal = false
+      this.$refs['formMeasure'].$refs['dk-form'].resetFields()
+      this.itemForm.itemList = [{
+        itemId:null,
+        itemDescribe:null,
+        stdPrice:null,
+        salePrice:null,
+        validLong:null,
+        extraLong:null,
+      }]
+    },
+
+    /**
+    * @desc   : 提交明细
+    * @author : 常皓宁
+    * @date   : 2024/4/16 8:50
+    */
+    submitMeasure() {
+      this.$refs['formMeasure'].validate().then(valid => {
+        // 校验
+        if (!valid) {
+          return
+        }
+        let param = Object.assign({}, this.itemForm)
+        this.loading = true
+        //保存
+        this.excute(this.$service.activityItemService,this.$service.activityItemService.updateItem,param).then(res => {
+          this.loading = false
+          if (res.code === 200) {
+            this.$Message.success(res.message)
+            //关闭
+            this.cancelMeasure()
+          } else {
+            this.$Message.error(res.message)
+          }
+        })
+
+      })
+    },
+
+    /**
+    * @desc   : 新建明细
+    * @author : 常皓宁
+    * @date   : 2024/4/16 10:32
+    */
+    addItem(){
+      if (this.$refs['table-select'].batchKeys.length == 1) {
+        if (!this.$refs['table-select'].batchRows[0].activityId) {
+          this.$Message.error(this.$t('W_068'))
+          return
+        }
+        this.itemModal = true
+        this.itembutton === 'add'
+        this.totalForm.activityId = this.$refs['table-select'].batchRows[0].activityId
+        this.getActivity(this.totalForm.activityId)
+      } else {
+        this.$Message.error(this.$t('W_040'))
+      }
+    },
+
+    /**
+    * @desc   : 编辑明细
+    * @author : 常皓宁
+    * @date   : 2024/4/16 11:36
+    */
+    editItem(){
+      if (this.$refs['table-select'].batchKeys.length == 1) {
+        if (!this.$refs['table-select'].batchRows[0].activityId) {
+          this.$Message.error(this.$t('W_068'))
+          return
+        }
+        this.itemModal = true
+        this.itembutton === 'edit'
+        this.totalForm.activityId = this.$refs['table-select'].batchRows[0].activityId
+        this.getActivity(this.totalForm.activityId)
+        this.getActivityItem(this.totalForm.activityId)
+      } else {
+        this.$Message.error(this.$t('W_040'))
+      }
+    },
+
+    /**
+    * @desc   : 获取总单信息
+    * @author : 常皓宁
+    * @date   : 2024/4/16 9:05
+    */
+    getActivity(id){
+      this.excuteNoParam(this.$service.activityService, this.$service.activityService.selectById, [id], false).then(res =>{
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.totalForm = res.data
+          this.itemForm.activityId = id
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    /**
+     * @desc   : 获取明细信息
+     * @author : 常皓宁
+     * @date   : 2024/4/16 9:05
+     */
+    getActivityItem(id){
+      let params = {
+        activityId:id
+      }
+      this.excute(this.$service.activityItemService, this.$service.activityItemService.selectByCond, params,false).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          let list = res.data.list
+          list.forEach(it=>{
+            delete it.itemId
+          })
+          this.itemForm.itemList = list
+        } else {
+          this.$Message.error(res.message)
+        }
+      })
+    },
+    /**
+    * @desc   : 查询数据
+    * @author : 常皓宁
+    * @date   : 2024/4/15 13:34
+    */
+    getData(params) {
+      this.tableData = null;
+      this.tableDataDetail_activityItem = null;
+      return this.excute(this.$service.activityService, this.$service.activityService.selectByCond, params)
+    },
+    /**
+    * @desc   : 行改变事件
+    * @author : 常皓宁
+    * @date   : 2024/4/15 13:34
+    */
+    currentChange({row}) {
+      this.loading = true
+      this.tableDataDetail_activityItem = null;
+      let params = {
+        activityId: row.activityId,
+      }
+      this.excute(this.$service.activityItemService, this.$service.activityItemService.selectByCond, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.tableDataDetail_activityItem = res.data.list;
+        }
+        this.loading = false
+      })
+    },
+
+    /**
+    * @desc   : 分类改变
+    * @author : 常皓宁
+    * @date   : 2024/4/15 10:54
+    */
+    handleGrade(row){
+      if(row){
+        if(row.kindCode === '活动分类-版本'){
+          this.gradeFlag = true
+          this.funFlag = false
+          this.bannerFlag = false
+        }
+        if(row.kindCode === '活动分类-功能'){
+          this.gradeFlag = false
+          this.funFlag = true
+          this.bannerFlag = false
+        }
+        if(row.kindCode === '活动分类-广告'){
+          this.gradeFlag = false
+          this.funFlag = false
+          this.bannerFlag = true
+          this.formData.flgBanner = true
+        }
+        if(row.kindCode === '活动分类-充值'){
+          this.gradeFlag = false
+          this.funFlag = false
+          this.bannerFlag = false
+        }
+      }
+    },
+    /**
+    * @desc   : 功能选择后事件
+    * @author : 常皓宁
+    * @date   : 2024/4/15 12:59
+    */
+    funIdOk(val){
+      this.formData.funName = val[0]['menuName']
+    },
+    /**
+    * @desc   : 发布
+    * @author : 常皓宁
+    * @date   : 2024/4/15 14:46
+    */
+    release() {
+      let rows = this.$refs['table-select'].batchRows;
+      if (rows && rows.length > 0) {
+        //发布的不能发布
+        if (rows[0].activityStatus == '活动状态-发布') {
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_115')}));
+          return
+        }
+        this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('发布')}), title: this.$t('systemQuestion')},
+          {
+            ok: () => {
+              this.loading = true
+              this.excuteNoParam(this.$service.activityService, this.$service.activityService.release, [rows[0].activityId], false).then(res => {
+                if (res.code === this.$config.SUCCESS_CODE) {
+                  this.$Message.success(this.$t('I_001', {'param': this.$t('发布')}))
+                } else {
+                  this.$Message.warning(res.message)
+                }
+                this.loading = false
+              })
+            },
+          })
+      }
+    },
+
+    /**
+     * @desc   : 下架
+     * @author : 常皓宁
+     * @date   : 2024/3/21 12:59
+     */
+    shelves() {
+      let rows = this.$refs['table-select'].batchRows;
+      if (rows && rows.length > 0) {
+        //发布的不能发布
+        if (rows[0].activityStatus == '活动状态-未发布') {
+          this.$Message.warning(this.$t('W_007', {'param': this.$t('W_116')}));
+          return
+        }
+        this.$IBMessage({content: this.$t('Q_002', {'param': this.$v('下架')}), title: this.$t('systemQuestion')},
+          {
+            ok: () => {
+              this.loading = true
+              this.excuteNoParam(this.$service.activityService, this.$service.activityService.shelves, [rows[0].activityId], false).then(res => {
+                if (res.code === this.$config.SUCCESS_CODE) {
+                  this.$Message.success(this.$t('I_001', {'param': this.$t('下架')}))
+                  this.getData()
+                } else {
+                  this.$Message.warning(res.message)
+                }
+                this.loading = false
+              })
+            },
+          })
+      }
+    },
+
+    /**
+    * @desc   : 校验按钮
+    * @author : 常皓宁
+    * @date   : 2024/4/15 13:34
+    */
+    openValidData(btnName, rows) {
+      if (btnName === 'edit') {
+
+      }
+      return true;
+    },
+
+    /**
+    * @desc   : 提交事件
+    * @author : 常皓宁
+    * @date   : 2024/4/15 13:19
+    */
+    saveData() {
+      let params = {...this.formData}
+      if(params.beginDate){
+        params.beginDate = params.beginDate.format('yyyy-MM-dd')
+      }
+      if(params.endDate){
+        params.endDate = params.endDate.format('yyyy-MM-dd')
+      }
+      console.log('this.params', this.params)
+      if (this.modalParams.button === this.$config.formMode.add) {
+        delete this.params.activityId // 解决提示主键重复的问题,删除主键代码
+        return this.excute(this.$service.activityService, this.$service.activityService.insert, params)
+      } else {
+        return this.excute(this.$service.activityService, this.$service.activityService.update, params)
+      }
+    },
+    /**
+    * @desc   : 清空窗体
+    * @author : 常皓宁
+    * @date   : 2024/4/15 13:34
+    */
+    clear() {
+      this.formData = {
+        activityId: null,
+        activityName: null,
+        activityDescribe:null,
+        activityType:null,
+        activityStatus:null,
+        beginDate:null,
+        endDate:null,
+        flgBanner:false,
+        activityPath:'{}',
+        activityUrl:null,
+        gradeCode:null,
+        funId:null,
+        funName:null,
+        appCode:null,
+        cpIds:null,
+      }
+    },
+    /**
+     * @desc   : 通过id查询
+     * @author : 常皓宁
+     * @date   : 2024/2/29 8:49
+     */
+    detail(id) {
+      return this.excuteNoParam(this.$service.activityService, this.$service.activityService.selectById, [id], false).then(res=>{
+          if (res.code === this.$config.SUCCESS_CODE) {
+            this.formData = res.data
+            let activityType = this.formData.activityType
+            if(activityType === '活动分类-版本'){
+              this.gradeFlag = true
+              this.funFlag = false
+              this.bannerFlag = false
+            }
+            if(activityType === '活动分类-功能'){
+              this.gradeFlag = false
+              this.funFlag = true
+              this.bannerFlag = false
+            }
+            if(activityType === '活动分类-广告'){
+              this.gradeFlag = false
+              this.funFlag = false
+              this.bannerFlag = true
+              this.formData.flgBanner = true
+            }
+            if(activityType === '活动分类-充值'){
+              this.gradeFlag = false
+              this.funFlag = false
+              this.bannerFlag = false
+            }
+          }
+      })
+    },
+    /**
+    * @desc   : 活动分类
+    * @author : 常皓宁
+    * @date   : 2024/4/12 14:58
+    */
+    getActivityType() {
+      // 查询数据
+      let params = {
+        kindType: this.$config.kindType.activityType
+      }
+      this.excute(this.$service.commonService, this.$service.commonService.getDataKind, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.typeList = res.data
+        }
+      })
+    },
+    /**
+     * @desc   : 活动状态
+     * @author : 常皓宁
+     * @date   : 2024/4/12 14:58
+     */
+    getActivityStatus() {
+      // 查询数据
+      let params = {
+        kindType: this.$config.kindType.activityStatus
+      }
+      this.excute(this.$service.commonService, this.$service.commonService.getDataKind, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.statusList = res.data
+        }
+      })
+    },
+
+    /**
+    * @desc   : 获取版本代码
+    * @author : 常皓宁
+    * @date   : 2024/4/15 10:47
+    */
+    getGrade(){
+      // 查询数据
+      let params = {
+      }
+      this.excute(this.$service.commonService, this.$service.commonService.getGrade, params).then(res => {
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.gradeList = res.data
+        }
+      })
+    },
+
+    /**
+     * @desc   : 加载数据
+     * @author : 付斌
+     * @date   : 2024/3/1 11:16
+     */
+    initData() {
+      this.getActivityType();
+      this.getActivityStatus();
+      this.getGrade()
+    },
+  },
+  created() {
+    this.primaryKey = 'activityId'  // 设置主键Id
+    this.routeObjName = 'activity'  // 设置路由名称
+  }
+}
+</script>
+