Sfoglia il codice sorgente

Merge branch 'develop_yh44' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh43

# Conflicts:
#	public/version.json
#	src/views/promotionRulesManagement/promotionManagement/addModal.vue
#	src/views/promotionRulesManagement/promotionManagement/editModal.vue
#	src/views/promotionRulesManagement/promotionManagement/list.vue
lilei 10 mesi fa
parent
commit
5db104e4aa

+ 1 - 1
public/version.json

@@ -1,4 +1,4 @@
 {
-    "version": "2.2.43",
+    "version": "2.2.45",
     "message": "发现有新版本发布,确定更新系统?"
 }

+ 114 - 28
src/api/promoActive.js

@@ -1,6 +1,6 @@
 import { axios } from '@/utils/request'
 
-//  优惠活动 列表  有分页
+//  修理厂促销  列表  有分页
 export const promoActiveList = (params) => {
   const url = `/promoActive/queryPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
@@ -9,60 +9,146 @@ export const promoActiveList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-        'module': encodeURIComponent('列表查询')
+    headers: {
+      'module': encodeURIComponent('列表查询')
     }
   })
 }
-//  优惠活动 保存
-export const promoActiveSave = (params) => {
+//  修理厂促销 新增
+export const promoActiveCreate = (params) => {
   return axios({
-    url: '/promoActive/save',
+    url: '/promoActive/create',
     data: params,
     method: 'post',
-    headers:{
-        'module': encodeURIComponent('新增')
+    headers: {
+      'module': encodeURIComponent('新增')
     }
   })
 }
-//  优惠活动 删除
+
+//  修理厂促销 详情
+export const promoActiveDetail = (params) => {
+  const url = `/promoActive/findBySn/${params.sn}`
+  return axios({
+    url: url,
+    method: 'get'
+  })
+}
+//  修理厂促销 编辑
+export const promoActiveUpdate = (params) => {
+  return axios({
+    url: '/promoActive/update',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('编辑')
+    }
+  })
+}
+
+//  修理厂促销 删除
 export const promoActiveDel = (params) => {
   const url = `/promoActive/delete/${params.sn}`
   return axios({
     url: url,
     method: 'get',
-    headers:{
-        'module': encodeURIComponent('删除')
+    headers: {
+      'module': encodeURIComponent('删除')
     }
   })
 }
-//  优惠活动 详情
-export const promoActiveDetail = (params) => {
-  const url = `/promoActive/findBySn/${params.sn}`
+// 修理厂促销 促销发布
+export const promoActivePublish = (params) => {
   return axios({
-    url: url,
-    method: 'get'
+    url: '/promoActive/updatePublish',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('促销发布')
+    }
   })
 }
-//  优惠活动 启禁用
-export const promoActiveEnable = (params) => {
-  const url = `/promoActive/enable/${params.sn}/${params.flag}`
+// 修理厂促销 选择产品列表
+export const queryWaitingProductPage = (params) => {
+  const url = `/promoRuleProduct/queryWaitingProductPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
     url: url,
-    method: 'get',
-    headers:{
-        'module': encodeURIComponent('启用禁用')
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 修理厂促销   保存产品范围
+export const saveBatchEntity = (params) => {
+  return axios({
+    url: '/promoRuleProductRange/saveBatchEntity',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('保存产品范围')
+    }
+  })
+}
+// 批量创建产品
+export const promoCreateBatch = (params) => {
+  return axios({
+    url: '/promoRuleProduct/createBatch',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('批量创建产品')
     }
   })
 }
-//  优惠活动 详情
-export const promoActiveDetailD = (params) => {
-  const url = `/promoActive/findDetailBySn/${params.sn}`
+export const promoUpdateBatch = (params) => {
+  return axios({
+    url: '/promoRuleProduct/updateBatch',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('批量创建产品')
+    }
+  })
+}
+// 获取已选产品列表数据  有分页
+export const promoRuleProductList = (params) => {
+  const url = `/promoRuleProduct/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
   return axios({
     url: url,
-    method: 'get',
-    headers:{
-        'module': encodeURIComponent('优惠活动明细')
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 批量删除
+export const deleteBatch = (params) => {
+  return axios({
+    url: '/promoRuleProduct/deleteBatch',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('批量删除')
+    }
+  })
+}
+// 删除产品范围  数据变化 promoActiveSn  productTypeSnList
+export const deleteByProductType = (params) => {
+  return axios({
+    url: '/promoRuleProduct/deleteByProductType',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('批量删除')
     }
   })
 }

+ 11 - 9
src/components/index.less

@@ -51,7 +51,7 @@
   }
 }
 .ant-btn-primary.button-primary[disabled],.ant-btn-primary.button-info[disabled],.ant-btn-primary.button-warning[disabled],.ant-btn-primary.button-geekblue[disabled],.ant-btn-primary.button-purple[disabled]{
-   color: rgba(255, 255, 255, 0.5);
+   color: rgba(255, 255, 255, 0.6);
  }
 .ant-btn-primary.button-success {
   background-color: #11b116;
@@ -278,11 +278,12 @@
       user-select: auto !important;
     }
   }
-  input:disabled{
-    opacity: 1!important;
-    color: #fff!important;
-    -webkit-text-fill-color: #fff!important;
-  }
+  
+  // input:disabled{
+  //   opacity: 1!important;
+  //   color: #fff!important;
+  //   -webkit-text-fill-color: #fff!important;
+  // }
   .ant-table-row{
     td{
       > div:not(.ant-table-row-expand-icon):empty::after{
@@ -343,11 +344,12 @@
 .ant-alert-message, .ant-card-head{
   color: #000000!important;
 }
-.ant-select-disabled .ant-select-selection,.ant-cascader-picker-disabled{
-  color: #999!important;
+.ant-input-disabled, .ant-input-number-disabled, .ant-input-number input[readonly], .ant-input[disabled], .ant-select-disabled .ant-select-selection,.ant-cascader-picker-disabled{
+  background-color: #f8f8f8 !important;
+    color: #333 !important;
+    cursor: not-allowed;
 }
 
-
 //头部样式
 .header-bar{
   margin:6px auto;

+ 5 - 2
src/components/newThem.less

@@ -1,13 +1,16 @@
+// The prefix to use on all css classes from ant-pro.
+@ant-pro-prefix: ant-pro;
 @font-size-base: 12px;
 @table-row-hover-bg: color(~`colorPalette('@{primary-color}', 0.5) `);
 @text-color: fade(@black, 100%);
-@disabled-bg: #fafafa;
+@disabled-bg: #DEDEDE;
 @modal-body-padding: 15px;
 @menu-item-height: 30px;
 @collapse-header-padding: 6px 8px;
 @table-padding-vertical: 5px;
 @table-padding-horizontal: 5px;
-@input-disabled-bg: #fdfdfd;
+@border-color-base: #dedede;
+@border-color-split: #dedede;
 
 // vue-easytable new style
 @ve-default-font-size: 12px;

+ 22 - 0
src/config/router.config.js

@@ -3465,6 +3465,28 @@ export const asyncRouterMap = [
                   hidden: true,
                   permission: 'M_promotionManagementList'
                 }
+              },
+              {
+                path: 'add/:sn/:pageType',
+                name: 'promotionManagementAdd',
+                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/promotionManagement/edit.vue'),
+                meta: {
+                  title: '新增修理厂促销',
+                  icon: 'file-ppt',
+                  hidden: true,
+                  permission: 'B_promotionManagementAdd'
+                }
+              },
+              {
+                path: 'edit/:sn/:pageType',
+                name: 'promotionManagementEdit',
+                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/promotionManagement/edit.vue'),
+                meta: {
+                  title: '编辑修理厂促销',
+                  icon: 'file-ppt',
+                  hidden: true,
+                  permission: 'B_promotionManagementEdit'
+                }
               }
             ]
           },

+ 89 - 65
src/views/promotionRulesManagement/promotionManagement/addModal.vue

@@ -1,7 +1,7 @@
 <template>
   <a-modal
     centered
-    class="promotion-add-modal"
+    class="promotion-modal"
     :footer="null"
     :maskClosable="false"
     :title="isEdit?'编辑':'新增'"
@@ -10,7 +10,7 @@
     :width="900">
     <a-spin :spinning="spinning" tip="Loading...">
       <a-form-model
-        id="promotion-add-form"
+        id="promotion-form"
         ref="ruleForm"
         :model="form"
         :rules="rules"
@@ -18,11 +18,10 @@
         :wrapper-col="formItemLayout.wrapperCol"
       >
         <a-form-model-item label="促销名称" prop="name">
-          <a-input id="promotion-add-name" v-model="form.name" placeholder="请输入促销名称(最多30个字符)" :maxLength="30"></a-input>
+          <a-input v-model="form.name" placeholder="请输入促销名称(最多30个字符)" :maxLength="30"></a-input>
         </a-form-model-item>
         <a-form-model-item label="促销时间" prop="time">
           <a-range-picker
-            id="promotion-add-time"
             style="width:100%"
             v-model="form.time"
             :format="dateFormat"
@@ -30,7 +29,7 @@
             @change="dateChange"
             :placeholder="['开始时间', '结束时间']" />
         </a-form-model-item>
-        <a-form-model-item label="参与经销商" prop="promoBuyerList">
+        <a-form-model-item label="参与经销商" prop="dealerSnList">
           <a-row :gutter="15">
             <!-- <a-col :md="15" :sm="24">
               <a-select
@@ -42,15 +41,15 @@
               </a-select>
             </a-col> -->
             <a-col :md="5" :sm="24">
-              <a-button id="promotion-add-chooseDealer" type="primary" :loading="spinning" @click="handleDealerModal">选择经销商</a-button>
+              <a-button type="primary" :loading="spinning" @click="handleDealerModal">选择经销商</a-button>
             </a-col>
             <a-col :md="6" :sm="24" v-show="chooseDealerList && chooseDealerList.length>0">
               已{{ chooseDealerList.length }}选项
             </a-col>
             <a-col :md="24" :sm="24" v-show="chooseDealerList && chooseDealerList.length>0">
               <div class="buyerBox">
-                <a-tag closable v-for="con in chooseDealerList" :key="con.buyerSn" :id="'promotion-add-tag-'+con.buyerSn" @close="delBuyerName(con)">
-                  {{ con.buyerName }}
+                <a-tag closable v-for="con in chooseDealerList" :key="con.dealerSn" @close="delBuyerName(con)">
+                  {{ con.dealerName }}
                 </a-tag>
               </div>
             </a-col>
@@ -59,7 +58,7 @@
         <a-form-model-item style="margin-bottom:10px;" label="促销描述" prop="description" :wrapperCol="{ span: 16 }" :labelCol="{ span: 4 }">
           <a-textarea
             :rows="5"
-            id="promotion-add-remark"
+            id="promotion-remark"
             :maxLength="500"
             v-model="form.description"
             placeholder="请输入备注(最多500个字符)"
@@ -67,8 +66,21 @@
         </a-form-model-item>
       </a-form-model>
       <div class="btn-cont">
-        <a-button id="promotion-add-cancel" @click="isShow = false" >取消</a-button>
-        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-add-save" @click="handleSave">确定</a-button>
+        <a-button id="promotion-modal-back" @click="isShow = false" >取消</a-button>
+        <a-button
+          v-if="!isEdit"
+          type="primary"
+          style="margin-left: 15px;"
+          :loading="spinning"
+          id="promotion-modal-save"
+          @click="handleSave">确定</a-button>
+        <a-button
+          v-else
+          type="primary"
+          style="margin-left: 15px;"
+          :loading="spinning"
+          id="promotion-modal-save"
+          @click="handleEdit">确定</a-button>
       </div>
     </a-spin>
     <!-- 选择经销商 -->
@@ -94,7 +106,8 @@ import moment from 'moment'
 // 组件
 import chooseDealer from './chooseDealer'
 // 接口
-import { promoTerminalSave, promoTerminalDetail } from '@/api/promoTerminal'
+import { promoActiveCreate, promoActiveDetail, promoActiveUpdate } from '@/api/promoActive'
+
 export default {
   name: 'PromotionAddModal',
   mixins: [commonMixin],
@@ -105,47 +118,45 @@ export default {
       type: Boolean,
       default: false
     },
-    itemId: { // 单据id
+    itemId: {
+      //  弹框显示状态
       type: String,
       default: ''
     }
   },
   data () {
     return {
-      spinning: false,
       isShow: this.openModal, //  是否打开弹框
-      openDealerModal: false, // 选择经销商弹框
-      // 表单label 布局
+      openDealerModal: false,
+      spinning: false,
       formItemLayout: {
         labelCol: { span: 4 },
         wrapperCol: { span: 16 }
       },
-      // 提交参数
       form: {
-        promoActiveSn: undefined, // 活动sn
-        name: '', // 活动名称
-        time: [], // 时间
-        activeDateStart: undefined, // 开始时间
-        activeDateEnd: undefined, // 结束时间
-        activeDateEnable: '1', // 活动时间启用
-        buyerLimitEnable: '1', // 部分经销商
-        description: '', // 活动描述
-        promoBuyerList: [] // 参与经销商列表
+        promoActiveSn: undefined,
+        name: '',
+        time: [],
+        activeDateStart: undefined,
+        activeDateEnd: undefined,
+        activeDateEnable: '1',
+        buyerLimitEnable: '1',
+        description: '',
+        dealerSnList: []
       },
-      // 校验规则
       rules: {
-        promoBuyerList: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
+        dealerSnList: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
         time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
         name: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
         description: [{ required: true, message: '请输入促销描述', trigger: 'blur' }]
       },
-      dateFormat: 'YYYY-MM-DD', // 时间格式
-      isEdit: false, // 是否编辑
+      dateFormat: 'YYYY-MM-DD',
+      isEdit: false,
       chooseDealerList: []// 选择经销商列表
     }
   },
   methods: {
-    // 促销时间不可选范围
+    // 禁用日期时间
     disabledDate (current) {
       return current && current < moment().startOf('day')
     },
@@ -153,50 +164,40 @@ export default {
     handleDealerModal () {
       this.openDealerModal = true
       const _this = this
+      let arr = []
       if (_this.chooseDealerList.length == 0) {
-        _this.form.promoBuyerList = []
+        _this.form.dealerSnList = []
+      } else {
+        arr = _this.chooseDealerList.map(item => { return item.dealerSn })
       }
-      const arr = _this.chooseDealerList.map(item => {
-        return item.buyerSn
-      })
       // 选择经销商回显
       _this.$nextTick(() => {
         _this.$refs.dealerChoose.pageInit(arr)
       })
     },
-    // 选择活动时间
+    // 日期  change
     dateChange (date, dateStrings) {
       if (dateStrings && dateStrings[0]) {
         this.form.time = dateStrings
-        this.form.activeDateStart = date.length ? dateStrings[0] : ''
-        this.form.activeDateEnd = date.length ? dateStrings[1] : ''
+        this.form.activeDateStart = date.length ? dateStrings[0] + ' 00:00:00' : ''
+        this.form.activeDateEnd = date.length ? dateStrings[1] + ' 23:59:59' : ''
       } else {
         this.form.time = []
       }
     },
     // 添加经销商
     handleAddDealer (list) {
-      this.chooseDealerList = list.map(con => {
-        return {
-          buyerSn: con.dealerSn,
-          buyerName: con.dealerName
-        }
-      })
+      this.chooseDealerList = list
       this.openDealerModal = false
       // 移除表单必填项
-      this.$refs.ruleForm.clearValidate('promoBuyerList')
+      this.$refs.ruleForm.clearValidate('dealerSnList')
     },
-    // 获取详情信息
+    // 获取编辑详情
     getEditInfo () {
-      promoTerminalDetail({ sn: this.itemId }).then(res => {
+      promoActiveDetail({ sn: this.itemId }).then(res => {
         if (res.status == 200) {
           const data = res.data
-          this.chooseDealerList = data.promoBuyerList
-          data.promoBuyerList = data.promoBuyerList.map(item => {
-            return {
-              buyerSn: item.buyerSn
-            }
-          })
+          this.chooseDealerList = data.promoDealerList
           data.time = [data.activeDateStart, data.activeDateEnd]
           this.form = data
         }
@@ -204,24 +205,48 @@ export default {
     },
     // 删除所选经销商
     delBuyerName (row) {
-      const pot = this.chooseDealerList.findIndex(con => { return con.buyerSn == row.buyerSn })
+      const pot = this.chooseDealerList.findIndex(con => { return con.dealerSn == row.dealerSn })
       this.chooseDealerList.splice(pot, 1)
     },
-    // 保存促销
+    //  保存促销
     handleSave () {
       const _this = this
       const newArr = this.chooseDealerList.map(item => {
-        return {
-          buyerSn: item.buyerSn
+        return item.dealerSn
+      })
+      this.form.dealerSnList = newArr
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const form = JSON.parse(JSON.stringify(_this.form))
+          delete form.time
+          _this.spinning = true
+          promoActiveCreate(form).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+            }
+            _this.spinning = false
+          })
+        } else {
+          _this.spinning = false
+          return false
         }
       })
-      this.form.promoBuyerList = newArr
+    },
+    // 修改促销
+    handleEdit () {
+      const _this = this
+      const newArr = this.chooseDealerList.map(item => {
+        return item.dealerSn
+      })
+      this.form.dealerSnList = newArr
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           const form = JSON.parse(JSON.stringify(_this.form))
           delete form.time
           _this.spinning = true
-          promoTerminalSave(form).then(res => {
+          promoActiveUpdate(form).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.isShow = false
@@ -235,8 +260,8 @@ export default {
         }
       })
     },
-    // 重置表单
-    resetForm () {
+    // 重置
+    reSetForm () {
       this.$refs.ruleForm.resetFields()
       this.form = {
         promoActiveSn: undefined,
@@ -247,7 +272,7 @@ export default {
         activeDateEnable: '1',
         buyerLimitEnable: '1',
         description: '',
-        promoBuyerList: []
+        dealerSnList: []
       }
       this.isEdit = false
       this.chooseDealerList = []
@@ -262,10 +287,9 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.resetForm()
+        this.reSetForm()
       } else {
         this.isEdit = !!this.itemId
-        // 编辑
         if (this.itemId) {
           this.getEditInfo()
         }
@@ -276,7 +300,7 @@ export default {
 </script>
 
 <style lang="less">
-.promotion-add-modal {
+.promotion-modal {
 	.ant-modal-body {
 		padding: 40px 40px 24px;
 	}

+ 40 - 51
src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue

@@ -2,12 +2,12 @@
   <a-spin :spinning="spinning" tip="Loading...">
     <!-- 搜索条件 -->
     <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
-      <a-form layout="inline" id="chooseDealer-form" @keyup.enter.native="$refs.table.refresh(true)">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
         <a-row :gutter="15">
           <a-col :md="8" :sm="24" v-if="pageType=='dealerPromotion'">
-            <a-form-item label="地区">
-              <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-            </a-form-item>
+            <a-form-model-item label="地区">
+              <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+            </a-form-model-item>
           </a-col>
           <a-col :md="8" :sm="24">
             <a-form-item label="经销商名称/别名">
@@ -20,9 +20,9 @@
             </a-form-item>
           </a-col>
           <a-col :md="8" :sm="24">
-            <a-form-item label="商户级别" prop="dealerLevel">
-              <v-select code="DEALER_LEVEL" id="chooseDealer-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
-            </a-form-item>
+            <a-form-model-item label="商户级别" prop="dealerLevel">
+              <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            </a-form-model-item>
           </a-col>
           <a-col :md="8" :sm="24" v-if="pageType!='viewDealers'">
             <a-form-item label="所在区域/分区">
@@ -32,13 +32,13 @@
           <div v-else>
             <a-col :md="8" :sm="24">
               <a-form-item label="审核状态">
-                <v-select code="AUDIT_STATE" id="chooseDealer-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
+                <v-select code="AUDIT_STATE" id="viewDealers-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
               </a-form-item>
             </a-col>
             <a-col :md="8" :sm="24">
-              <a-form-item label="地区">
-                <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-              </a-form-item>
+              <a-form-model-item label="地区">
+                <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+              </a-form-model-item>
             </a-col>
           </div>
           <a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
@@ -49,7 +49,7 @@
       </a-form>
       <!-- 列表 -->
       <div style="margin-bottom: 10px">
-        <a-button id="chooseDealer-batchAdd" type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
+        <a-button type="primary" ghost :loading="loading" @click="handleBatchAudit">批量添加</a-button>
         <span style="margin-left: 5px">
           <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
         </span>
@@ -75,23 +75,27 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-// 组件
 import { STable, VSelect } from '@/components'
 import AreaList from '@/views/common/areaList.js'
+import { dealerQueryList, getDealerListInfo } from '@/api/dealer'
 import subarea from '@/views/common/subarea.js'
 import dealerType from '@/views/common/dealerType.js'
-// 接口
-import { dealerQueryList, getDealerListInfo } from '@/api/dealer'
 export default {
   name: 'ChooseDealer',
   mixins: [commonMixin],
   components: { STable, VSelect, subarea, AreaList, dealerType },
   props: {
-    pageType: { // 添加or编辑
+    pageType: {
       type: String,
       default: ''
     },
-    itemSn: { // 单据sn
+    parentData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    },
+    itemSn: {
       type: String,
       default: ''
     }
@@ -99,42 +103,39 @@ export default {
   data () {
     return {
       spinning: false,
-      dealerType: [], // 商户类型默认值
-      //  查询条件
-      queryParam: {
-        nameLike: '', // 商户名称
-        dealerType1: undefined, //  商户类型1
-        dealerType2: undefined, //  商户类型2
-        dealerLevel: null, //  商户等级
+      dealerType: [],
+      queryParam: { //  查询条件
+        nameLike: '',
+        dealerType1: undefined, //  商户类型
+        dealerType2: undefined, //  商户类型
+        dealerLevel: null,
         subareaArea: {
           subareaSn: undefined, //  区域
           subareaAreaSn: undefined // 分区
         },
-        auditState: undefined, //  审核状态
-        provinceSn: undefined, // 省
-        citySn: undefined, // 市
-        districtSn: undefined // 区
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined
       },
       pagination: {
-        pageSize: 20, // 每页数
-        showSizeChanger: true, // 是否显示页码输入框
-        pageSizeOptions: ['20', '50', '100', '200', '500'] // 可选页码
+        pageSize: 20,
+        showSizeChanger: true,
+        pageSizeOptions: ['20', '50', '100', '200', '500']
       },
-      pageFlag: false, // 经销商加载完成是否
-      chooseInfo: [], // 已选商户
-      selectedRowKeys: [], // 已选商户key
-      dealerList: [], // 商户列表
-      tableHeight: 0, // 表格高度
+      pageFlag: false,
+      chooseInfo: [],
+      selectedRowKeys: [],
+      dealerList: [],
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
       loading: false // 批量添加loading
     }
   },
   computed: {
-    // 已选商户数量
     selectCount () {
       return this.selectedRowKeys && this.selectedRowKeys.length
     },
-    // 列
     columns () {
       const arr = [
         { title: '经销商名称', dataIndex: 'dealerName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
@@ -144,7 +145,6 @@ export default {
         { title: '所在区域', dataIndex: 'subareaArea.subareaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '所在分区', dataIndex: 'subareaArea.subareaAreaName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      // 如果时经销商促销活动
       if (this.pageType === 'dealerPromotion') {
         arr.unshift({ title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '30%', align: 'center', ellipsis: true })
       }
@@ -152,11 +152,9 @@ export default {
     }
   },
   methods: {
-    // 全选
     onSelectChange (selectedRowKeys) {
       this.selectedRowKeys = selectedRowKeys
     },
-    // 表格页码变化
     handlePage (pagination, filters, sorter) {
       const pager = { ...this.pagination }
       pager.pageNo = pagination.pageSize != pager.pageSize ? 1 : pagination.current
@@ -165,7 +163,6 @@ export default {
       this.pagination = pager
       this.loadData()
     },
-    // 查询列表
     loadData () {
       this.spinning = true
       const params = { pageSize: 20, pageNo: 1, ...this.pagination }
@@ -185,7 +182,6 @@ export default {
           }
           this.dealerList = data.list
           this.pagination = pagination
-          // 是否已选
           if (this.chooseInfo.length > 0 && !this.pageFlag) {
             this.pageFlag = true
             this.selectedRowKeys = this.chooseInfo
@@ -198,28 +194,24 @@ export default {
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
     },
-    // 地区选择
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
-    // 查询
     searchForm () {
       this.loadData()
       this.spinning = false
     },
-    // 分区选择
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
-    // 商户类型选项
     getDealerType (v, o) {
       this.queryParam.dealerType1 = v[0]
       this.queryParam.dealerType2 = v[1]
     },
-    //  重置列表
+    //  重置
     resetSearchForm () {
       this.dealerType = []
       this.queryParam = {
@@ -261,7 +253,6 @@ export default {
       this.spinning = false
       this.$emit('plAdd', dealerInfoList.data)
     },
-    // 绑定关系
     handleAdd (row) {
       if (row.subareaArea) {
         const _this = this
@@ -279,7 +270,6 @@ export default {
         this.$emit('add', row)
       }
     },
-    // 页面初始化
     pageInit (data) {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -289,7 +279,6 @@ export default {
       this.chooseInfo = data || []
       this.resetSearchForm()
     },
-    // 设置表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 285

+ 299 - 0
src/views/promotionRulesManagement/promotionManagement/chooseProductsModal.vue

@@ -0,0 +1,299 @@
+<template>
+  <a-drawer
+    :zIndex="zIndex"
+    title="选择产品"
+    placement="right"
+    :visible="isShow"
+    width="80%"
+    :get-container="false"
+    :wrap-style="{ position: 'absolute' }"
+    :headerStyle="{ padding: '10px' }"
+    @close="onClose"
+    wrapClassName="chooseProducts-modal">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="products-con">
+        <!-- 搜索条件 -->
+        <div class="table-page-search-wrapper">
+          <a-form-model
+            ref="ruleForm"
+            class="form-model-con"
+            layout="inline"
+            :model="queryParam"
+            :label-col="formItemLayout.labelCol"
+            :wrapper-col="formItemLayout.wrapperCol">
+            <a-row :gutter="15">
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品编码">
+                  <a-input id="chooseProducts-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="原厂编码">
+                  <a-input id="chooseProducts-code" v-model.trim="queryParam.origCode" allowClear placeholder="请输入原厂编码"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品名称">
+                  <a-input id="chooseProducts-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品分类">
+                  <productTypeAll placeholder="请选择产品分类" @change="changeProductType" v-model="queryParam.productType" id="chooseProducts-productType"></productTypeAll>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24">
+                <a-form-model-item label="产品品牌">
+                  <ProductBrand id="chooseProducts-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="8" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh()" :disabled="disabled" id="chooseProducts-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetData" :disabled="disabled" id="chooseProducts-reset">重置</a-button>
+              </a-col>
+            </a-row>
+          </a-form-model>
+        </div>
+        <div style="margin-bottom: 10px">
+          <a-button type="primary" ghost :loading="loading" @click="handleSave">批量添加</a-button>
+          <span style="margin-left: 5px">
+            <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
+          </span>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.productSn"
+          rowKeyName="productSn"
+          :row-selection="{ columnWidth: 40, getCheckboxProps: record => ({ props: { disabled: !record.terminalPrice } })}"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :pagination="{pageSizeOptions: ['20','50','100','200','500']}"
+          :data="loadData"
+          :defaultLoadData="false"
+          style="max-height:700px;"
+          :scroll="{ y: 550 }"
+          bordered>
+          <!-- 产品分类 -->
+          <template slot="productType" slot-scope="text, record">
+            <span v-if="record.productTypeName2 || record.productTypeName3">{{ record.productTypeName2 }} {{ record.productTypeName3 ? '>' : '' }} {{ record.productTypeName3 }}</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 包装数 -->
+          <template slot="productQty" slot-scope="text, record">
+            <span v-if="record.packQty">
+              {{ record.packQty }}{{ record.unit }}/{{ record.packQtyUnit?record.packQtyUnit:'--' }}
+            </span>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </div>
+    </a-spin>
+  </a-drawer>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { queryWaitingProductPage } from '@/api/promoActive'
+import ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
+export default {
+  name: 'ChooseProductsModal',
+  components: { STable, ProductBrand, productTypeAll },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    chooseData: {// 隐藏选择的产品
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    chooseType: {// 选中的分类
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    chooseProduct: {// 当前行选中的数据
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    itemSn: {
+      type: String,
+      default: ''
+    },
+    zIndex: { // 层级
+      type: [String, Number],
+      default: 1000
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 20 }
+      },
+      queryParam: { //  查询条件
+        productName: '', // 产品名称
+        productCode: '', //  产品编码
+        origCode: '', // 原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productType: [],
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '', //  产品三级分类
+        hideProductSnList: [],
+        productTypeSnList: []
+      },
+      chooseDataList: [],
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '产品编码', dataIndex: 'code', align: 'center', width: '12%' },
+        { title: '产品名称', dataIndex: 'name', align: 'left', width: '18%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'origCode', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '市级价', dataIndex: 'cityPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        // { title: '特约价', dataIndex: 'specialPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '品牌', dataIndex: 'productBrandName', align: 'center', width: '8%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, align: 'center' },
+        { title: '包装数', scopedSlots: { customRender: 'productQty' }, width: '6%', align: 'center' },
+        { title: '单位', dataIndex: 'unit', align: 'center', width: '6%', ellipsis: true, customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        params.hideProductSnList = this.chooseData
+        params.productTypeSnList = this.chooseType
+        params.promoActiveSn = this.itemSn
+        return queryWaitingProductPage(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+            const _this = this
+            // 选中回显
+            if (_this.chooseProduct && _this.chooseProduct.length > 0) {
+              const selectedRows = []
+              let selectedRowKeys = []
+              data.list.forEach(item => {
+                const flag = _this.chooseProduct.includes(item.productSn)
+                if (flag) {
+                  selectedRows.push(item)
+                }
+              })
+              selectedRowKeys = _this.chooseProduct
+              _this.$nextTick(() => { // 页面渲染完成后的回调
+                _this.$refs.table.setTableSelected(selectedRowKeys, selectedRows) // 设置表格选中项
+              })
+            }
+          }
+          _this.spinning = false
+          return data
+        })
+      },
+      rowSelectionInfo: null
+    }
+  },
+  computed: {
+    selectCount () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 重置数据
+    resetData () {
+      this.queryParam.productName = ''
+      this.queryParam.productCode = ''
+      this.queryParam.origCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.queryParam.productType = []
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    },
+    //  清空选项
+    resetSearchForm () {
+      this.$refs.table.clearSelected()
+    },
+    // 批量添加
+    handleSave () {
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+        this.$message.warning('请在列表勾选后再进行操作!')
+        return
+      }
+      const resultList = JSON.parse(JSON.stringify(this.rowSelectionInfo && this.rowSelectionInfo.selectedRows))
+      this.$emit('ok', resultList)
+      this.isShow = false
+    },
+    // 关闭弹框
+    onClose () {
+      this.isShow = false
+      this.$emit('close')
+    },
+    //  产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.resetSearchForm()
+        this.rowSelectionInfo = null
+        this.$emit('close')
+      } else {
+        const _this = this
+        _this.resetData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseProducts-modal{
+    .products-con{
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 400 - 0
src/views/promotionRulesManagement/promotionManagement/detailModal.vue

@@ -0,0 +1,400 @@
+<template>
+  <a-modal
+    centered
+    class="promotion-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="70%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <div class="detailModal-con">
+        <a-form-model
+          id="promotion-basicInfo-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol" >
+          <a-form-model-item label="标题" prop="title">
+            {{ form.title }}
+          </a-form-model-item>
+          <a-form-model-item label="排序" prop="sort">
+            {{ form.sort }}
+          </a-form-model-item>
+          <a-form-model-item label="封面图片" prop="imageSet">
+            <img
+              :src="con"
+              alt="图片走丢了"
+              width="80"
+              height="80"
+              v-for="(con,i) in imageSet"
+              style="margin-right:10px;object-fit: cover;"
+              :key="i"/>
+            <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
+          </a-form-model-item>
+          <a-form-model-item label="内容类型" prop="contentType">
+            {{ form.contentType==='IMAGE_CONTENT'?'图文展示':form.contentType==='VIDEO'?'视频展示':'跳转链接' }}
+          </a-form-model-item>
+          <div v-if="form.contentType==='IMAGE_CONTENT'">
+            <a-form-model-item label="内容" prop="content" >
+              <div class="box" v-html="form.content"></div>
+            </a-form-model-item>
+            <a-form-model-item label="是否发布" prop="publishFlag" >
+              {{ form.publishFlag?form.publishFlag==='1'?'是':'否':'--' }}
+            </a-form-model-item>
+          </div>
+          <div v-if="form.contentType==='VIDEO'">
+            <a-form-model-item label="内容" prop="content" >
+              <video
+                ref="videoPlayer"
+                width="230"
+                height="150"
+                controls
+                loop
+                controlsList="nodownload">
+                <source :src="form.content" type="video/mp4">
+              </video>
+            </a-form-model-item>
+            <a-form-model-item label="是否发布" prop="publishFlag" >
+              {{ form.publishFlag?form.publishFlag==='1'?'是':'否':'--' }}
+            </a-form-model-item>
+          </div>
+          <div v-if="form.contentType==='LINK'">
+            <a-form-model-item label="内容" prop="ruleType">
+              {{ form.content }}
+            </a-form-model-item>
+          </div>
+          <div v-show="form.contentType==='LINK'&&form.content === '/pagesB/promoDetail'">
+            <a-form-model-item label="基本规则" prop="ruleType">
+              {{ form.promoRule&&form.promoRule.ruleType?form.promoRule.ruleType==='ticket'?'指定产品返代金券':'--':'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="券名称" prop="ruleName">
+              {{ form.promoRule&&form.promoRule.ruleName?form.promoRule.ruleName:'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="券副标题" prop="ruleTitle">
+              {{ form.promoRule&&form.promoRule.ruleTitle?form.promoRule.ruleTitle:'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="生成方式" prop="ruleBaseType">
+              {{ form.promoRule&&form.promoRule.ruleBaseType?form.promoRule.ruleBaseType==='bill'?'按订单生成券':'按订单产品款数生成券':'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="券有效期" prop="validType" >
+              <span>
+                {{ form.promoRule&&form.promoRule.validType?form.promoRule.validType==='FIXED'?'固定日期':'领取后,立即生效,':'--' }}
+              </span>
+              <span class="timeBox" v-if="form.promoRule&&form.promoRule.validType&&form.promoRule.validType==='FIXED'">{{ form.promoRule.validStartDate }}~{{ form.promoRule.validEndDate }}</span>
+              <span class="timeBox" v-else>有效期{{ form.promoRule&&form.promoRule.validDays?form.promoRule.validDays:'--' }}天</span>
+            </a-form-model-item>
+            <a-form-model-item label="券适用范围" prop="range" >
+              全部产品
+            </a-form-model-item>
+            <a-form-model-item label="使用说明" prop="ruleExplain" >
+              {{ form.promoRule&&form.promoRule.ruleExplain?form.promoRule.ruleExplain:'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="加盟商编辑" prop="dealerEditFlag" >
+              {{ form.dealerEditFlag?form.dealerEditFlag==='1'?'是':'否':'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="是否发布" prop="publishFlag" >
+              {{ form.publishFlag?form.publishFlag==='1'?'是':'否':'--' }}
+            </a-form-model-item>
+            <a-form-model-item label="产品范围" prop="productRangeList" >
+              <div v-if="productRangeList&&productRangeList.length>0" style="margin-bottom:10px;">
+                <a-tree-select
+                  v-model="productRangeList"
+                  :tree-data="productTypeList"
+                  tree-checkable
+                  :disabled="true"
+                  :getPopupContainer="triggerNode => triggerNode.parentNode"
+                  :replaceFields="{children:'children',title: 'productTypeName',key: 'productTypeSn',value: 'productTypeSn'}"
+                  placeholder="请选择产品范围" />
+              </div>
+              <div v-else>--</div>
+            </a-form-model-item>
+            <a-form-model-item label="返券产品" prop="publishFlag" >
+              <div class="productTable">
+                <s-table
+                  class="sTable"
+                  ref="table"
+                  size="small"
+                  :rowKey="(record) => record.id"
+                  :columns="columns"
+                  :data="loadData"
+                  :defaultLoadData="false"
+                  :style="{ maxHeight: 300+'px' }"
+                  :scroll="{ y:230 }"
+                  bordered>
+                </s-table>
+              </div>
+            </a-form-model-item>
+          </div>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button id="promotion-basicInfo-modal-back" @click="isShow = false">关闭</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { productTypeQuery } from '@/api/productType'
+import { promoActiveDetail, promoRuleProductList } from '@/api/promoActive'
+
+export default {
+  name: 'DetailModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      productTypeList: [],
+      productRangeList: [],
+      form: {
+        promoActiveSn: undefined, // 促销活动sn
+        title: '', // 标题
+        imageSet: '', // 图片
+        contentType: 'IMAGE_CONTENT', // 内容类型
+        content: '', // 内容
+        contentLink: '', // 链接内容
+        sort: undefined, // 排序
+        ruleEnableFlag: '1', // 参数配置 1勾选配置  0不能配置
+        publishFlag: '0',
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        promoRule: {
+          ruleType: 'ticket', // 基本规则类型
+          productRangeFlag: '', // 产品范围标记 0无  1有产品范围
+          productRangeList: [], // 产品范围列表
+          ruleName: '', // 券名称
+          ruleTitle: '', // 副标题
+          ruleBaseType: 'category', // 券生成方式
+          ruleExplain: '', // 使用说明
+          validType: undefined, // 券有效期类型
+          validStartDate: undefined, // 券生效时间
+          validEndDate: undefined, // 券失效时间
+          validDays: undefined, // 券有效期天数
+          range: '1'
+        }
+      },
+      imageSet: [],
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动价', dataIndex: 'price', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
+        { title: '返券金额', dataIndex: 'ruleValue', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
+        { title: '参考终端价', dataIndex: 'terminalPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } }
+      ],
+      rules: {
+        title: [{ required: true, message: '请输入标题名称', trigger: 'blur' }],
+        imageSet: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
+        content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }],
+        contentLink: [{ required: true, message: '请输入对应内容', trigger: 'blur' }],
+        publishFlag: [{ required: true, message: '请选择是否发布', trigger: 'change' }],
+        range: [{ required: true, message: '请选择券适用范围', trigger: 'change' }],
+        ruleType: [{ required: true, message: '请选择基本规则', trigger: 'change' }],
+        ruleName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
+        ruleBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
+        validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
+        ruleDetailList: [{ type: 'array', required: true, message: '请选择券内容', trigger: 'blur' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        params.promoActiveSn = this.itemSn
+        return promoRuleProductList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 重置
+    resetSearchForm () {
+      this.form = {
+        promoActiveSn: undefined, // 促销活动sn
+        title: '', // 标题
+        imageSet: '', // 图片
+        contentType: 'IMAGE_CONTENT', // 内容类型
+        content: '', // 内容
+        contentLink: '', // 链接内容
+        sort: undefined, // 排序
+        ruleEnableFlag: '1', // 参数配置 1勾选配置  0不能配置
+        publishFlag: '0',
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        promoRule: {
+          ruleType: 'ticket', // 基本规则类型
+          productRangeFlag: '', // 产品范围标记 0无  1有产品范围
+          productRangeList: [], // 产品范围列表
+          ruleName: '', // 券名称
+          ruleTitle: '', // 副标题
+          ruleBaseType: 'category', // 券生成方式
+          ruleExplain: '', // 使用说明
+          validType: undefined, // 券有效期类型
+          validStartDate: undefined, // 券生效时间
+          validEndDate: undefined, // 券失效时间
+          validDays: undefined, // 券有效期天数
+          range: '1'
+        }
+      }
+      this.imageSet = []
+    },
+    // 获取列表详情
+    getDetail () {
+      promoActiveDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          if (res.data.contentType === 'LINK') {
+            console.log('加载产品范围')
+            this.$nextTick(() => {
+              this.getTreeData()
+            })
+            if (res.data.promoRule && res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.length > 0) {
+              this.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
+            } else {
+              this.productRangeList = []
+            }
+          }
+          if (res.data.imageSet) {
+            this.form.imageSet = res.data.imageSet.join(',')
+            this.imageSet = res.data.imageSet
+          }
+          this.form = res.data
+        }
+      })
+    },
+    // 获取产品范围数据
+    getTreeData () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      } else {
+        this.getDetail()
+        this.$nextTick(() => {
+          this.$refs.table.refresh(true)
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotion-basicInfo-modal{
+    .detailModal-con{
+      max-height: 600px;
+      overflow-y: scroll;
+    }
+    .timeBox{
+      color:#ed1c24;
+      opacity: .7;
+    }
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .promotion-basicInfo-con{
+      margin-top:10px;
+    }
+    .ant-form-item{
+      margin-bottom:0 !important;
+    }
+    .buyerBox{
+      border:1px solid #d9d9d9;margin-top:10px;border-radius:4px;padding:4px 10px;background:#f2f2f2;max-height:130px;overflow-y:scroll;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    //处理滚动条不显示
+    .tabBox{
+       max-height:100px;
+       overflow-y:scroll;
+    }
+   .tabBox::-webkit-scrollbar {
+       width: 0px;
+    }
+    .tabBox::-webkit-scrollbar-track {
+      background: transparent;
+    }
+
+    .tabBox::-webkit-scrollbar-thumb {
+      background: transparent;
+    }
+
+    .tabBox::-webkit-scrollbar-button {
+      display: none;
+    }
+    // 设置input  禁用颜色
+    .ant-form-item-control .ant-input[disabled]{
+      color:#333333;
+      background:#ffffff;
+    }
+   .ant-radio-button-wrapper-disabled{
+     color:#333333;
+     padding:0 16px;
+   }
+   .ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked{
+       background-color: #ed1c24 !important;
+       color:#ffffff;
+       padding:0 16px;
+   }
+   /deep/.ant-select-disabled .ant-select-selection, .ant-cascader-picker-disabled{
+      color:#333 !important;
+      background:#fff;
+   }
+   .productTable{
+     width:100%;
+   }
+   /deep/.ant-select-disabled .ant-select-selection--multiple .ant-select-selection__choice{
+     color:#333;
+   }
+  }
+
+</style>

+ 842 - 0
src/views/promotionRulesManagement/promotionManagement/edit.vue

@@ -0,0 +1,842 @@
+<template>
+  <div class="promotionEdit-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="promotionEdit-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="promotionEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" />返回列表</a>
+          <span v-if="pageType==='edit'" style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">促销名称:{{ promotionName||'--' }}</span>
+        </template>
+      </a-page-header>
+      <!-- 表单 -->
+      <a-card :bordered="false" class="promotionEdit-cont">
+        <a-form-model
+          id="promotionEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-row>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="标题" prop="title" :label-col="{span:4}" :wrapper-col="{span:16}">
+                <a-input
+                  id="promotionEdit-title"
+                  :maxLength="30"
+                  v-model.trim="form.title"
+                  placeholder="请输入标题名称(最多30个字符)"
+                  :disabled="isDisabled"
+                  allowClear/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="排序" prop="sort" :label-col="{span:4}" :wrapper-col="{span:16}">
+                <a-input-number
+                  style="width:100%"
+                  id="promotionEdit-sort"
+                  :disabled="isDisabled"
+                  allowClear
+                  placeholder="请输入排序数字(数字越大越靠后)"
+                  v-model="form.sort"
+                  :min="0"
+                  :max="999999"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="封面图片" prop="imageSet">
+                <Upload
+                  v-if="pageType==='add'||(pageType==='edit'&&!isDisabled)"
+                  class="upload"
+                  id="promotionEdit-imageSet"
+                  v-model="form.imageSet"
+                  ref="imageSet"
+                  :fileSize="10"
+                  :maxNums="1"
+                  @change="changeImage"
+                  listType="picture-card"></Upload>
+                <div v-else>
+                  <img
+                    :src="con"
+                    alt="图片走丢了"
+                    width="80"
+                    height="80"
+                    v-for="(con,i) in imageSet"
+                    style="margin-right:10px;object-fit: cover;"
+                    :key="i" />
+                </div>
+                <span class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</span>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="内容类型" prop="contentType">
+                <v-select
+                  v-model="form.contentType"
+                  id="promotion-saleStatus"
+                  code="PROMO_CONTENT_TYPE"
+                  showType="radio"
+                  :disabled="isDisabled"
+                  @change="changeContentType"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="内容" prop="content" v-show="form.contentType =='IMAGE_CONTENT'">
+                <editor
+                  v-show="pageType === 'add'||(pageType === 'edit'&&!isDisabled)"
+                  id="promotionEdit-editor"
+                  ref="editor"
+                  class="promotionEdit-editor"
+                  @on-change="editorChange"
+                  :cache="false"></editor>
+                <div v-if="(pageType === 'edit')&&isDisabled" class="box" v-html="form.content"></div>
+              </a-form-model-item>
+              <a-form-model-item label="上传视频" prop="content" v-show="form.contentType =='VIDEO'">
+                <Upload
+                  v-if="pageType==='add'||(pageType==='edit'&&!isDisabled)"
+                  class="upload"
+                  id="promotionEdit-imageSet"
+                  v-model="form.content"
+                  fileType="video/mp4"
+                  ref="videoSet"
+                  :fileSize="100"
+                  :maxNums="1"
+                  @change="changeVideo"
+                ></Upload>
+                <div v-else>
+                  <video
+                    ref="videoPlayer"
+                    width="230"
+                    height="150"
+                    controls
+                    loop
+                    controlsList="nodownload">
+                    <source :src="form.content" type="video/mp4">
+                  </video>
+                </div>
+                <span class="upload-desc">说明:文件最大100M;视频:mp4.avi.flv</span>
+              </a-form-model-item>
+              <a-form-model-item label="跳转链接" prop="contentLink" v-if="form.contentType =='LINK'">
+                <a-input
+                  style="width:50%;"
+                  :disabled="form.linkType==='1'||(pageType==='edit'&&isDisabled)"
+                  id="promotionEdit-title"
+                  :maxLength="100"
+                  v-model.trim="form.contentLink"
+                  placeholder="请输入跳转链接"
+                  @blur="handleLink"
+                  allowClear />
+                <a-select
+                  id="promotionEdit-title"
+                  :disabled="isDisabled"
+                  default-value="货架促销"
+                  @change="handleLinkType"
+                  style="width: 120px;margin-left:10px;"
+                  v-model="form.linkType">
+                  <a-select-option value="1">
+                    货架促销
+                  </a-select-option>
+                  <a-select-option value="2">
+                    其他
+                  </a-select-option>
+                </a-select>
+                <!-- <span class="tip upload-desc">
+                  选择【货架促销】,促销内容会同步显示在促销模块内
+                </span> -->
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row v-if="form.contentType !='LINK' ||(form.contentType ==='LINK'&&form.linkType==='2') ">
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="是否发布" prop="publishFlag">
+                <a-radio-group button-style="solid" v-model="form.publishFlag">
+                  <a-radio-button value="1">
+                    是
+                  </a-radio-button>
+                  <a-radio-button value="0">
+                    否
+                  </a-radio-button>
+                </a-radio-group>
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+          <a-row v-if="form.contentType ==='LINK'&&form.linkType==='1'">
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="基本规则" prop="promoRule.ruleType">
+                <v-select
+                  style="width:40%;"
+                  v-model="form.promoRule.ruleType"
+                  placeholder="请选择基本规则"
+                  id="promotionEdit-ruleType"
+                  code="PROMO_ACTIVE_RULE_TYPE"
+                  :disabled="isDisabled"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="券名称" :label-col="{span:4}" :wrapper-col="{span:16}" prop="promoRule.ruleName">
+                <a-input
+                  :disabled="isDisabled"
+                  id="promotionEdit-ruleName"
+                  :maxLength="20"
+                  v-model.trim="form.promoRule.ruleName"
+                  placeholder="请输入券名称(最多20个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="券副标题" :label-col="{span:4}" :wrapper-col="{span:16}">
+                <a-input
+                  :disabled="isDisabled"
+                  id="promotionEdit-ruleTitle"
+                  :maxLength="20"
+                  v-model.trim="form.promoRule.ruleTitle"
+                  placeholder="请输入券副标题(最多20个字符)"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="生成方式" prop="promoRule.ruleBaseType">
+                <v-select
+                  style="width:40%;"
+                  v-model="form.promoRule.ruleBaseType"
+                  id="promotionEdit-ruleBaseType"
+                  code="PROMO_RULE_BASE_TYPE"
+                  :disabled="isDisabled"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="券有效期" prop="promoRule.validType">
+                <v-select
+                  style="width:40%;"
+                  v-model="form.promoRule.validType"
+                  placeholder="请选择券有效期"
+                  id="promotionEdit-validType"
+                  code="PROMO_RULE_TICKET_TYPE"
+                  :disabled="isDisabled"
+                  @change="handleValidType"
+                  allowClear></v-select>
+                <a-range-picker
+                  v-show="form.promoRule.validType==='FIXED'"
+                  style="width:40%;margin-left:10px;"
+                  v-model="time"
+                  :format="dateFormat"
+                  @change="dateChange"
+                  :disabled="isDisabled"
+                  :disabled-date="disabledDate"
+                  :placeholder="['开始时间', '结束时间']" />
+                <span style="width:40%;margin-left:10px;" v-show="form.promoRule.validType==='LIMIT'">
+                  有效期<a-input-number
+                    style="margin:0 5px;"
+                    v-model="form.promoRule.validDays"
+                    :step="1"
+                    :max="99999999"
+                    :min="1"
+                    :disabled="isDisabled"
+                    :precision="0"/>天
+                </span>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item class="productName" label="券适用范围" prop="promoRule.range">
+                全部产品
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="使用说明" prop="promoRule.ruleExplain">
+                <a-input
+                  v-model="form.promoRule.ruleExplain"
+                  :disabled="isDisabled"
+                  type="textarea"
+                  placeholder="请输入使用说明(最多50个字符)"
+                  :maxLength="50" />
+              </a-form-model-item>
+            </a-col>
+            <div style="text-align:center;" v-if="!isShowNextStep"><a-button type="primary" size="large" :disabled="isDisabled" @click="handleSave('part')" >保存后设置产品</a-button></div>
+            <div v-if="form.contentType =='LINK'&&isShowNextStep">
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <a-form-model-item label="产品范围">
+                  <div id="setPromotion-productRange" style="position:relative;">
+                    <a-tree-select
+                      v-model="productRangeList"
+                      :maxTagCount="12"
+                      :tree-data="productTypeList"
+                      tree-checkable
+                      :disabled="isDisabled"
+                      :getPopupContainer="triggerNode => triggerNode.parentNode"
+                      :replaceFields="{children:'children',title: 'productTypeName',key: 'productTypeSn',value: 'productTypeSn'}"
+                      @change="onChangeTree"
+                      placeholder="请选择产品范围" />
+                  </div>
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <a-form-model-item label="返券产品" prop="promoRule.range">
+                  <div class="productInfo flex-center">
+                    <div>
+                      返券金额<a-input-number
+                        v-model="form.promoRule.ruleValue"
+                        style="margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="2"
+                        :max="99999999"
+                        :disabled="isDisabled"
+                        size="small"/> 元
+                      <a-button type="primary" :disabled="isDisabled" class="button-primary" size="small" @click="handleBatchAdd">批量设置</a-button>
+                    </div>
+                    <a-button type="primary" :disabled="isDisabled" @click="handleAddProduct" size="small">添加产品</a-button>
+                  </div>
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <div style="width: 83%;margin:0 auto 10px;">
+                  <productTable ref="chooseProductList" :promoActiveSn="$route.params.sn" :disabledVal="isDisabled"></productTable>
+                </div>
+              </a-col>
+              <a-col
+                :xs="24"
+                :sm="24"
+                :md="24"
+                :lg="24"
+                :xl="24">
+                <a-form-model-item label="加盟商编辑" prop="promoRule.dealerEditFlag">
+                  <a-radio-group button-style="solid" :disabled="isDisabled" v-model="form.promoRule.dealerEditFlag">
+                    <a-radio-button value="1">
+                      是
+                    </a-radio-button>
+                    <a-radio-button value="0">
+                      否
+                    </a-radio-button>
+                  </a-radio-group>
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <a-form-model-item label="是否发布" prop="promoRule.publishFlag">
+                  <a-radio-group button-style="solid" v-model="form.promoRule.publishFlag">
+                    <a-radio-button value="1">
+                      是
+                    </a-radio-button>
+                    <a-radio-button value="0">
+                      否
+                    </a-radio-button>
+                  </a-radio-group>
+                </a-form-model-item>
+              </a-col>
+            </div>
+          </a-row>
+        </a-form-model>
+      </a-card>
+    </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        class="button-primary"
+        :disabled="spinning"
+        id="productInfoEdit-submit-btn"
+        size="large"
+        @click="handleSave('all')"
+        v-if="form.contentType !='LINK'|| isShowNextStep ||(form.contentType ==='LINK'&&form.linkType ==='2')"
+        style="padding: 0 60px;">保存</a-button>
+    </div>
+    <!-- 添加产品 -->
+    <chooseProduct
+      ref="chooseProduct"
+      :chooseType="chooseTypeList"
+      :itemSn="$route.params.sn"
+      :openModal="showProModal"
+      @ok="addProductSuccess"
+      @close="closeProductModal"></chooseProduct>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+// 组件
+import { VSelect, Upload } from '@/components'
+import Editor from '@/components/WEeditor'
+import promotionShowModal from './promotionShowModal'
+import productTable from './productTable'
+import chooseProduct from './chooseProductsModal.vue'
+// 接口
+import { productTypeQuery } from '@/api/productType'
+import { promoActivePublish, promoActiveDetail, saveBatchEntity, promoCreateBatch, deleteByProductType } from '@/api/promoActive'
+export default {
+  name: 'ProductBrandEditModal',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, Editor, promotionShowModal, chooseProduct, productTable },
+  data () {
+    return {
+      spinning: false,
+      // 第一个表单 label 设置
+      formItemLayout: {
+        labelCol: { span: 2 },
+        wrapperCol: { span: 20 }
+      },
+      productRangeList: [], // 产品范围列表
+      // 链接配置内容
+      form: {
+        promoActiveSn: undefined, // 促销活动sn
+        title: '', // 标题
+        imageSet: '', // 图片
+        contentType: 'IMAGE_CONTENT', // 内容类型
+        content: '', // 内容
+        contentLink: '', // 链接内容
+        sort: undefined, // 排序
+        publishFlag: '0', // 是否发布
+        linkType: '1',
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        promoRule: {
+          ruleType: 'ticket', // 基本规则类型
+          ruleName: '', // 券名称
+          ruleTitle: '', // 副标题
+          ruleBaseType: 'category', // 券生成方式
+          ruleExplain: '', // 使用说明
+          validType: undefined, // 券有效期类型
+          validStartDate: undefined, // 券生效时间
+          validEndDate: undefined, // 券失效时间
+          validDays: undefined, // 券有效期天数
+          dealerEditFlag: '0', // 加盟商编辑 1是 0否
+          publishFlag: '0', // 是否发布
+          range: '1'
+        }
+      },
+      time: [], // 有效期
+      dateFormat: 'YYYY-MM-DD', // 有效期时间格式
+      promotionName: '', // 促销名称
+      pageType: undefined, // 页面类型
+      showProModal: false, // 打开产品弹窗
+      isShowNextStep: false, // 是否显示下一步 并提交一半配置产品
+      isDisabled: false, // 控制页面是否能编辑
+      chooseTypeList: [], // 已选中产品范围
+      imageSet: [], // 回显显示图片数据
+      productTypeList: [], // 产品范围    列表数据
+      rules: {
+        title: [{ required: true, message: '请输入标题名称', trigger: 'blur' }],
+        imageSet: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
+        content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }],
+        contentLink: [{ required: true, message: '请输入对应内容', trigger: 'blur' }],
+        publishFlag: [{ required: true, message: '请选择是否发布', trigger: 'change' }],
+        'promoRule.ruleType': [{ required: true, message: '请选择基本规则', trigger: 'change' }],
+        'promoRule.ruleName': [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
+        'promoRule.ruleBaseType': [{ required: true, message: '请选择生成方式', trigger: 'change' }],
+        'promoRule.validType': [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
+        'promoRule.publishFlag': [{ required: true, message: '请选择是否发布', trigger: 'change' }],
+        'promoRule.dealerEditFlag': [{ required: true, message: '请选择加盟商是否可编辑', trigger: 'change' }],
+        'promoRule.range': [{ required: true, message: '请选择', trigger: 'blur' }],
+        dealerEditFlag: [{ required: true, message: '请选择加盟商是否可编辑', trigger: 'change' }]
+      }
+    }
+  },
+  methods: {
+    // 禁用日期时间
+    disabledDate (current) {
+      return current && current < moment().startOf('day')
+    },
+    dateChange (date, dateString) {
+      this.time = date
+      if (dateString[0] != '' && dateString[1] != '') {
+        this.form.promoRule.validStartDate = dateString[0] + ' 00:00:00'
+        this.form.promoRule.validEndDate = dateString[1] + ' 23:59:59'
+      }
+    },
+    // 打开产品弹窗
+    insterProduct (obj) {
+      if (obj && Object.keys(obj).length > 0) {
+        this.chooseTypeList = obj.typeArr
+      }
+      this.showProModal = true
+    },
+    closeProductModal () {
+      this.showProModal = false
+    },
+    // 返回列表
+    handleBack () {
+      this.$router.push({ name: 'promotionManagementList', query: { closeLastOldTab: true } })
+    },
+    //  详情  挨个赋值原因:该接口和修理厂促销列表详情用的同一个接口,给后端传值过滤多余参数
+    getDetail () {
+      const _this = this
+      promoActiveDetail({ sn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          // 编辑按钮时,publishState 已发布,只能编辑是否发布;publishState已关闭,都可以编辑
+          if (_this.pageType === 'edit') {
+            _this.isDisabled = res.data.publishState === 'PUBLISH'
+            _this.form.promoRule.publishFlag = res.data.publishFlag
+            _this.form.promoRule.dealerEditFlag = res.data.dealerEditFlag
+          }
+          _this.form.publishFlag = res.data.publishFlag
+          _this.form.dealerEditFlag = res.data.dealerEditFlag
+          _this.form.promoActiveSn = res.data.promoActiveSn
+          _this.form.title = res.data.title
+          _this.form.contentType = res.data.contentType
+          _this.form.sort = res.data.sort
+          _this.imageSet = res.data.imageSet
+          if (res.data.imageSet) {
+            const images = res.data.imageSet.join(',')
+            _this.form.imageSet = images
+            if (this.pageType === 'add' || (this.pageType === 'edit' && res.data.publishState != 'PUBLISH')) {
+              _this.$refs.imageSet.setFileList(images)
+            }
+          }
+          _this.form.content = res.data.content
+          _this.promotionName = res.data.name || ''
+          _this.form.dealerEditFlag = res.data.dealerEditFlag
+          if (res.data.contentType == 'IMAGE_CONTENT') {
+            _this.$refs.editor.setHtml(res.data.content)
+          } else if (res.data.contentType == 'VIDEO') {
+            if (res.data.publishState != 'PUBLISH') {
+              _this.$refs.videoSet.setFileList(res.data.content)
+            }
+          } else if (res.data.contentType == 'LINK') {
+            _this.form.contentLink = res.data.content
+            _this.form.linkType = res.data.content != '/pagesB/promoDetail' ? '2' : '1'
+            if (res.data.promoRule) {
+              _this.isShowNextStep = true
+              _this.form.promoRule.range = '1'
+              _this.time = [res.data.promoRule.validStartDate, res.data.promoRule.validEndDate]
+              if (res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.length > 0) {
+                _this.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
+              }
+            }
+            _this.form.promoRule = { ..._this.form.promoRule, ...res.data.promoRule }
+          }
+        }
+      })
+    },
+    // 券有效期 change
+    handleValidType (con) {
+      this.form.promoRule.validType = con
+      if (con === 'FIXED') {
+        this.form.promoRule.validDays = undefined
+      } else {
+        this.time = []
+        this.form.promoRule.validStartDate = undefined
+        this.form.promoRule.validEndDate = undefined
+      }
+    },
+    //  确定保存  验证必填
+    handleSave (type) {
+      const _this = this
+      if (_this.form.contentType === 'LINK') {
+        _this.form.content = _this.form.contentLink
+      }
+      // 验证组件必填项
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.savePartInfo(type)
+        }
+      })
+    },
+    // 保存
+    savePartInfo (type) {
+      const _this = this
+      _this.form.promoActiveSn = this.$route.params.sn
+      var formData = JSON.parse(JSON.stringify(_this.form))
+      formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
+      // 跳转链接
+      if (formData.contentType == 'LINK') {
+        delete formData.contentLink
+        if (_this.productRangeList && _this.productRangeList.length > 0) {
+          formData.promoRule.productRangeList = _this.productRangeList.map(item => { return { productTypeSn: item } })
+        }
+        // 促销活动
+        if (_this.form.linkType === '1') {
+          if (_this.form.promoRule.validType === 'FIXED') {
+            if (!_this.form.promoRule.validStartDate || _this.form.promoRule.validStartDate.validEndDate) {
+              _this.$message.warning('请输入券有效期!')
+              return false
+            }
+          } else {
+            if (!_this.form.promoRule.validDays) {
+              _this.$message.warning('请输入券有效期!')
+              return false
+            }
+          }
+          formData.publishFlag = _this.form.promoRule.publishFlag
+          formData.dealerEditFlag = _this.form.promoRule.dealerEditFlag
+        } else {
+          formData.promoRule = undefined
+        }
+        if (_this.$refs.chooseProductList) {
+          const numInfo = _this.$refs.chooseProductList.getDataNum()
+          if (numInfo == 0) {
+            _this.$message.warning('请选择返券产品!')
+            return
+          }
+        }
+      } else {
+        formData.promoRule = undefined
+      }
+      _this.spinning = true
+
+      promoActivePublish(formData).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          if (type === 'all') {
+            _this.$nextTick(() => {
+              _this.handleBack()
+              _this.resetSearchForm()
+            })
+          } else {
+            _this.isShowNextStep = true
+            _this.getDetail()
+          }
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  图片上传
+    changeImage (file) {
+      this.form.imageSet = file
+    },
+    // 视频上传
+    changeVideo (file) {
+      this.form.content = file
+    },
+    //  文本编辑器
+    editorChange (html, text) {
+      this.form.content = html
+    },
+    // 重置
+    resetSearchForm () {
+      if (this.pageType == 'add' || (this.pageType == 'edit' && !this.isDisabled)) {
+        if (this.$refs.imageSet) {
+          this.$refs.imageSet.setFileList('')
+        }
+        if (this.$refs.videoSet) {
+          this.$refs.videoSet.setFileList('')
+        }
+      }
+      if (this.$refs.editor) {
+        this.$refs.editor.setHtml('')
+      }
+      this.form = {
+        promoActiveSn: undefined, // 促销活动sn
+        title: '', // 标题
+        imageSet: '', // 图片
+        contentType: 'IMAGE_CONTENT', // 内容类型
+        content: '', // 内容
+        contentLink: '', // 链接内容
+        sort: undefined, // 排序
+        publishFlag: '0', // 是否发布
+        linkType: '1',
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        productRangeList: [], // 产品范围列表
+        promoRule: {
+          ruleType: 'ticket', // 基本规则类型
+          ruleName: '', // 券名称
+          ruleTitle: '', // 副标题
+          ruleBaseType: 'category', // 券生成方式
+          ruleExplain: '', // 使用说明
+          validType: undefined, // 券有效期类型
+          validStartDate: undefined, // 券生效时间
+          validEndDate: undefined, // 券失效时间
+          validDays: undefined, // 券有效期天数
+          dealerEditFlag: '0', // 加盟商编辑 1是 0否
+          publishFlag: '0', // 是否发布
+          range: '1'
+        } // 链接配置内容
+      }
+      this.isShowNextStep = false
+      this.isDisabled = false
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields()
+      }
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields()
+      }
+    },
+    // 获取产品范围数据
+    getTreeData () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    },
+    // 选择内容类型
+    changeContentType (e) {
+      if (e === 'LINK') {
+        this.form.linkType = '1'
+        this.form.contentLink = '/pagesB/promoDetail'
+        this.form.content = '/pagesB/promoDetail'
+      } else {
+        this.form.linkType = undefined
+        this.form.contentLink = ''
+        this.form.content = ''
+      }
+      this.form.contentType = e
+    },
+    // 填入link内容
+    handleLink (con) {
+      if (!con.target.value || con.target.value != '/pagesB/promoDetail') {
+        this.form.linkType = '2'
+      } else {
+        this.form.linkType = '1'
+      }
+      this.form.contentLink = con.target.value
+    },
+    // 选择货架促销填入默认值
+    handleLinkType (val) {
+      this.form.contentLink = val === '2' ? '' : '/pagesB/promoDetail'
+    },
+    // 添加产品
+    handleAddProduct () {
+      this.chooseTypeList = this.productRangeList
+      this.showProModal = true
+    },
+    // 批量添加
+    handleBatchAdd () {
+      if (!this.form.promoRule.ruleValue) {
+        this.$message.warning('请输入返券金额(需大于0)!')
+        return
+      }
+      this.$refs.chooseProductList.editMorePrice(this.form.promoRule.ruleValue)
+    },
+    // 添加产品成功
+    addProductSuccess (list) {
+      const productArr = list.map(item => {
+        return {
+          promoActiveSn: this.$route.params.sn,
+          promoRuleSn: this.form.promoRule.promoRuleSn,
+          productCode: item.code,
+          productSn: item.productSn,
+          ruleValue: this.form.promoRule.ruleValue,
+          price: item.terminalPrice
+        }
+      })
+      promoCreateBatch(productArr).then(res => {
+        if (res.status == 200) {
+          this.showProModal = false
+          // 获取产品列表 有分页
+          this.$refs.chooseProductList.pageInit()
+        }
+      })
+    },
+    onChangeTree (e) {
+      deleteByProductType({ promoActiveSn: this.$route.params.sn, productTypeSnList: this.productRangeList || [] }).then(res => {
+        if (res.status == 200) {
+          this.$refs.chooseProductList.pageInit()
+        }
+      })
+      // 保存产品范围
+      const newArr = this.productRangeList.map(item => {
+        return {
+          promoActiveSn: this.$route.params.sn,
+          promoRuleSn: this.form.promoRule.promoRuleSn,
+          productTypeSn: item
+        }
+      })
+      saveBatchEntity({ list: newArr, promoActiveSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          console.log('保存产品范围成功')
+        }
+      })
+    },
+    pageInit () {
+      this.pageType = this.$route.params.pageType
+      if (this.pageType === 'edit') {
+        this.getDetail()
+      }
+      console.log('加载产品范围')
+      this.$nextTick(() => {
+        this.getTreeData()
+      })
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.promotionEdit-wrap{
+    position: relative;
+    height: 100%;
+    box-sizing: border-box;
+    padding-bottom:51px;
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
+    /deep/.ant-form-item{
+      margin-bottom:8px;
+    }
+    .promotionEdit-cont{
+      margin-bottom: 10px;
+    }
+    .upload{
+      width: 100%!important;
+    }
+    //  文本编辑器  工具栏样式换行
+    .promotionEdit-editor{
+      .w-e-toolbar{
+        flex-wrap: wrap;
+        z-index: 0;
+      }
+    }
+    //  商品图片描述
+    .upload-desc{
+      font-size: 12px;
+      color: #808695;
+    }
+    #promotionEdit-attachList{
+      height: auto;
+    }
+    .box{
+      border:1px solid #d9d9d9;
+      border-radius:4px;
+      padding:4px 11px;
+      color:rgba(0, 0, 0, 0.25);
+      cursor: not-allowed;
+      background:#fdfdfd;
+    }
+    .affix{
+      .ant-affix{
+        z-index: 101;
+        display:inline-block
+      }
+    }
+    /deep/.ant-radio-disabled + span{
+     color:#000!important;
+    }
+    .tip{
+      margin-left:10px;
+    }
+
+    .productInfo{
+      display:flex;
+      justify-content: space-between;
+    }
+    #setPromotion-productRange{
+      /deep/.ant-select-dropdown{
+        max-height:30vh !important;
+      }
+    }
+  }
+</style>

+ 69 - 104
src/views/promotionRulesManagement/promotionManagement/list.vue

@@ -3,50 +3,37 @@
     <a-card size="small" :bordered="false" class="promotion-wrap searchBoxNormal">
       <!-- 搜索条件 -->
       <div ref="tableSearch" class="table-page-search-wrapper">
-        <a-form layout="inline" id="promotionList-form" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
-                <rangeDate id="promotionList-creatDate" ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
+                <rangeDate ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="促销名称">
-                <a-input id="promotionList-promotionName" v-model.trim="queryParam.name" allowClear placeholder="请输入总部销退单号"/>
+                <a-input id="promotion-promotionName" v-model.trim="queryParam.name" allowClear placeholder="请输入促销名称"/>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
-              <a-form-item label="显示状态">
-                <a-select
-                  id="promotionList-showFlag"
-                  v-model="queryParam.showFlag"
-                  placeholder="请选择显示状态"
-                >
-                  <a-select-option id="promotionList-showFlag-1" :value="1">已显示</a-select-option>
-                  <a-select-option id="promotionList-showFlag-0" :value="0">未显示</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="促销状态">
                 <v-select
-                  v-model="queryParam.state"
+                  v-model="queryParam.publishState"
                   ref="saleStatus"
-                  id="promotionList-saleStatus"
+                  id="promotion-saleStatus"
                   code="PROMO_STATE"
                   placeholder="请选择促销状态"
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
-                <a-button id="promotionList-search" type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
-                <a-button id="promotionList-reset" style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
+                <a-button type="primary" :disabled="disabled" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" @click="resetSearchForm()">重置</a-button>
               </span>
             </a-col>
           </a-row>
         </a-form>
-
       </div>
     </a-card>
     <!-- 列表 -->
@@ -54,12 +41,11 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator" v-if="$hasPermissions('B_promotionManagementAdd')">
-          <a-button id="promotionList-add" type="primary" @click="openAddModal = true">新增</a-button>
+          <a-button type="primary" @click="openAddModal = true">新增</a-button>
         </div>
         <s-table
           class="sTable fixPagination"
           ref="table"
-          id="promotionList-table"
           :style="{ height: tableHeight+70+'px' }"
           size="small"
           :rowKey="(record) => record.id"
@@ -68,24 +54,9 @@
           :scroll="{ y: tableHeight }"
           :defaultLoadData="false"
           bordered>
-          <!-- 自定义表头 -->
-          <template slot="arrowFalgTitle" slot-scope="text, record">
-            <a-tooltip placement="top" :id="'promotionList-showState-'+record.id">
-              <template slot="title">
-                <span>易码通轮播促销展示显示状态</span>
-              </template>
-              显示状态<a-icon type="question-circle" :style="{ marginLeft: '10px' }" />
-            </a-tooltip>
-          </template>
-          <!-- 显示状态 -->
-          <template slot="arrowFalg" slot-scope="text, record">
-            <a-switch
-              checkedChildren="显示"
-              unCheckedChildren="隐藏"
-              :id="'promotionList-isEnable-'+record.id"
-              v-model="record.isEnable"
-              :disabled="record.state!='PUBLISH'"
-              @change="changeFlagHandle(record)" />
+          <!-- 促销状态 -->
+          <template slot="stateVal" slot-scope="text, record">
+            <span>{{ record.publishState==='UNPUBLISH'?'未发布':record.publishState==='PUBLISH'?'已发布':record.publishState==='CLOSE'?'已关闭':'已结束' }}</span>
           </template>
           <!-- 促销时间 -->
           <template slot="promotionTime" slot-scope="text, record">
@@ -93,7 +64,7 @@
           </template>
           <!-- 参与客户 -->
           <template slot="joinCustomers" slot-scope="text, record">
-            <span :id="'promotionList-promoBuyerSnSet-'+record.id" @click="handleCustomers(record)" v-if="record.promoBuyerSnSet&&record.promoBuyerSnSet.length>0">共有<span class="link-bule">{{ record.promoBuyerSnSet.length }}</span>个客户</span>
+            <span @click="handleCustomers(record)" v-if="record.dealerSnList&&record.dealerSnList.length>0">共有<span class="link-bule">{{ record.dealerSnList.length }}</span>个客户</span>
             <span v-else>共有0个客户</span>
           </template>
           <!-- 促销描述 -->
@@ -102,14 +73,14 @@
               <template slot="title">
                 <span>{{ record.description }}</span>
               </template>
-              <div :id="'promotionList-description-'+record.id" @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
+              <div @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
             </a-tooltip>
             <div v-else-if="!record.description" class="desc">--</div>
-            <div v-else :id="'promotionList-description-'+record.id" @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
+            <div v-else @click="promotionDesc(record)" class="link-bule">{{ record.description }}</div>
           </template>
           <!-- 促销展示 -->
           <template slot="salesShow" slot-scope="text, record">
-            <div @click="handleSaleShow(record)" :id="'promotionList-imageSet-'+record.id" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
+            <div @click="handleSaleShow(record)" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
               <img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
             </div>
             <div v-else-if="record.contentType=='LINK'&&record.imageSet && record.imageSet.length>0">
@@ -118,6 +89,7 @@
             <span v-else>--</span>
           </template>
           <!-- 操作 -->
+          <!-- state状态 END已结束    CLOSE已关闭    PUBLISH  已发布    UNPUBLISH  未发布 -->
           <template slot="action" slot-scope="text, record">
             <div>
               <a-button
@@ -125,30 +97,36 @@
                 type="link"
                 class="button-warning"
                 @click="promotionEdit(record)"
-                v-if="(record.state=='UNPUBLISH' || record.state=='CLOSE') && $hasPermissions('B_promotionManagementAdd')"
-                :id="'promotionList-edit-'+record.id" >促销编辑</a-button>
+                v-if="(record.publishState=='UNPUBLISH' || record.publishState=='CLOSE') && $hasPermissions('B_promotionManagementEdit')"
+                id="promotion-edit-btn">编辑</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-warning"
                 @click="handleRelease(record,'edit')"
-                v-if="(record.state=='PUBLISH' || record.state=='CLOSE')&&$hasPermissions('B_promotionManagementContent')"
-                :id="'promotionList-pubEdit-'+record.id" >发布修改</a-button>
+                v-if="((record.publishState=='PUBLISH'&&record.content!='/pagesB/promoDetail')||(record.publishState=='PUBLISH'&&record.content==='/pagesB/promoDetail'&&record.dealerEditFlag==='0') || record.publishState=='CLOSE')&&$hasPermissions('B_promotionManagementContent')"
+                id="promotion-modify-btn">发布修改</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-success"
+                @click="handleSee(record)"
+                v-if="(record.publishState=='PUBLISH' || record.publishState=='END')&&$hasPermissions('B_promotionManagementDetail')"
+                id="promotion-modify-btn">查看</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-info"
                 @click="handleRelease(record,'add')"
-                v-if="record.state=='UNPUBLISH'&&$hasPermissions('B_promotionManagementContent')"
-                :id="'promotionList-publish-'+record.id" >促销发布</a-button>
+                v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementContent')"
+                id="promotion-release-btn">发布</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-error"
-                v-if="record.state=='UNPUBLISH'&&$hasPermissions('B_promotionManagementDel')"
+                v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementDel')"
                 @click="handleDel(record)"
-                :id="'promotionList-del-'+record.id" >删除</a-button>
-              <span v-if="record.state=='End'">--</span>
+                id="promotion-del-btn">删除</a-button>
             </div>
           </template>
         </s-table>
@@ -161,71 +139,59 @@
       <promotion-show-modal ref="showModal" :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
       <!-- 新增 -->
       <addModal :openModal="openAddModal" :itemId="itemId" @close="closeAddModal" @ok="$refs.table.refresh()"></addModal>
-      <!-- 促销发布 -->
-      <promotion-edit-modal :pageType="pageType" :openModal="openPromotionEditModal" :itemId="itemId" @close="closePromotionEditModal" @ok="$refs.table.refresh()" />
+      <!-- 查看 -->
+      <detail-Modal :openModal="openDetailModal" :itemSn="itemId" @close="closeDetailModal" @ok="$refs.table.refresh()" />
     </a-card>
   </div>
 </template>
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-// 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
 import lookUpCustomersModal from './lookUpCustomersModal'
 import promotionDescModal from './promotionDescModal'
 import promotionShowModal from './promotionShowModal'
 import addModal from './addModal'
-import promotionEditModal from './editModal'
-// 接口
-import { promoTerminalList, promoTerminalDel, updateShowFlag } from '@/api/promoTerminal'
+import detailModal from './detailModal'
+import { updateShowFlag } from '@/api/promoTerminal'
+import { promoActiveList, promoActiveDel } from '@/api/promoActive'
 export default {
   name: 'PromotionList',
   mixins: [commonMixin],
-  components: {
-    STable,
-    VSelect,
-    rangeDate,
-    lookUpCustomersModal, // 参与客户弹框
-    promotionShowModal, // 促销展示弹框
-    promotionDescModal, // 促销描述弹框
-    addModal, // 新增弹框
-    promotionEditModal // 促销发布弹框
-  },
+  components: { STable, VSelect, rangeDate, lookUpCustomersModal, promotionShowModal, promotionDescModal, addModal, detailModal },
   data () {
     return {
       spinning: false,
-      tableHeight: 0, // 表格高度
+      tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
-      openCustomerModal: false, // 打开参与客户弹框
-      openDescModal: false, // 促销描述弹框
-      openShowModal: false, // 促销展示弹框
-      openAddModal: false, // 新增弹框
-      openPromotionEditModal: false, // 促销发布弹框
+      openCustomerModal: false,
+      openDescModal: false,
+      openShowModal: false,
+      openAddModal: false,
+      openDetailModal: false,
       createDate: [], //  创建时间
-      itemId: '', // 单据id
+      itemId: '',
       descCon: '', // 描述内容
       pageType: '', // 发布类型  add  促销发布  edit 发布修改
-      dealerSn: [], // 客户sn
+      dealerSn: [],
       // 查询参数
       queryParam: {
-        beginDate: undefined, // 开始时间
-        endDate: undefined, // 结束时间
-        name: '', // 促销名称
-        showFlag: undefined, // 显示状态
-        state: undefined // 状态
+        beginDate: undefined,
+        endDate: undefined,
+        name: '',
+        showFlag: undefined,
+        publishState: undefined
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        // 获取列表数据  有分页
-        return promoTerminalList(params).then(res => {
+        return promoActiveList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -237,17 +203,17 @@ export default {
           return data
         })
       },
-      // 列定义
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '促销名称', dataIndex: 'name', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '标题', dataIndex: 'title', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '8%', align: 'center' },
         { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '12%', align: 'center' },
         { title: '促销描述', scopedSlots: { customRender: 'salesDesc' }, width: '12%', align: 'center' },
         { title: '促销展示', scopedSlots: { customRender: 'salesShow' }, width: '6%', align: 'center' },
-        { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: '6%', align: 'center' },
-        { title: '促销状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        // { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: '6%', align: 'center' },
+        { title: '促销状态', scopedSlots: { customRender: 'stateVal' }, width: '6%', align: 'center' },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
     }
@@ -261,10 +227,10 @@ export default {
     handleCustomers (row) {
       this.openCustomerModal = true
       this.$nextTick(() => {
-        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.promoBuyerSnSet ? row.promoBuyerSnSet : undefined, promoActiveSn: row.promoActiveSn })
+        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.dealerSnList ? row.dealerSnList : undefined, promoActiveSn: row.promoActiveSn })
       })
     },
-    //  选择创建时间  change
+    //  创建时间  change
     dateCreateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
@@ -317,7 +283,7 @@ export default {
         centered: true,
         onOk () {
           _this.spinning = true
-          promoTerminalDel({ sn: row.promoActiveSn }).then(res => {
+          promoActiveDel({ sn: row.promoActiveSn }).then(res => {
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$refs.table.refresh()
@@ -329,37 +295,36 @@ export default {
         }
       })
     },
-    // 重置列表
     resetSearchForm () {
       this.$refs.rangeCreateDate.resetDate(this.createDate)
       this.queryParam.beginDate = undefined
       this.queryParam.endDate = undefined
       this.queryParam.name = ''
       this.queryParam.showFlag = undefined
-      this.queryParam.state = undefined
+      this.queryParam.publishState = undefined
       this.$refs.table.refresh(true)
     },
     // 促销发布
     handleRelease (row, type) {
+      const newType = row.imageSet && row.imageSet.length > 0 ? 'edit' : type
+      this.$router.push({ name: 'promotionManagementAdd', params: { sn: row.promoActiveSn, pageType: newType } })
+    },
+    // 打开详情
+    handleSee (row) {
+      this.openDetailModal = true
       this.itemId = row.promoActiveSn
-      this.pageType = row.imageSet && row.imageSet.length > 0 ? 'edit' : type
-      this.$nextTick(() => {
-        this.openPromotionEditModal = true
-      })
     },
-    // 关闭促销发布
-    closePromotionEditModal () {
-      this.openPromotionEditModal = false
+    // 关闭详情
+    closeDetailModal () {
+      this.openDetailModal = false
       this.itemId = ''
     },
-    // 页面初始化
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
         _this.setTableH()
       })
     },
-    // 设置表格高度
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 240

+ 39 - 38
src/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal.vue

@@ -2,7 +2,6 @@
   <a-modal
     centered
     class="lookUpCustomers-modal"
-    id="lookUpCustomers-modal"
     :footer="null"
     :maskClosable="false"
     title="参与客户"
@@ -13,28 +12,27 @@
       <a-card size="small" :bordered="false">
         <!-- 筛选条件 -->
         <div class="table-page-search-wrapper">
-          <a-form layout="inline" id="lookUpCustomers-form" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
             <a-row :gutter="15">
               <a-col :md="6" :sm="24">
-                <a-form-item label="地区">
-                  <AreaList id="lookUpCustomers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
-                </a-form-item>
+                <a-form-model-item label="地区">
+                  <AreaList id="actualSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
-                <a-form-item label="区域/分区">
-                  <subarea ref="subarea" id="lookUpCustomers-subarea" @change="subareaChange"></subarea>
-                </a-form-item>
+                <a-form-model-item label="区域/分区">
+                  <subarea ref="subarea" id="salesManagementList-subarea" @change="subareaChange"></subarea>
+                </a-form-model-item>
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="经销商名称">
-                  <a-input id="lookUpCustomers-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
-                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="lookUpCustomers-refresh">查询</a-button>
-                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="lookUpCustomers-reset">重置</a-button>
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
                 <a-button
-                  id="lookUpCustomers-export"
                   style="margin-left: 10px"
                   type="primary"
                   class="button-warning"
@@ -73,17 +71,16 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
-import { hdExportExcel } from '@/libs/exportExcel'
-// 组件
 import { STable } from '@/components'
+import ProductType from '@/views/common/productType.js'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
-// 接口
+import { hdExportExcel } from '@/libs/exportExcel'
 import { dealerExport } from '@/api/promoTerminal'
 import { dealerQueryList } from '@/api/dealer'
 export default {
   name: 'LookUpCustomersModal',
-  components: { STable, subarea, AreaList },
+  components: { STable, ProductType, subarea, AreaList },
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
@@ -94,31 +91,30 @@ export default {
   data () {
     return {
       spinning: false,
-      disabled: false, // 查询、重置按钮是否可以操作
       isShow: this.openModal, //  是否打开弹框
-      exportLoading: false, // 导出按钮loading
-      // 查询参数
+      disabled: false,
+      advanced: false,
+      exportShow: false,
+      exportLoading: false,
       queryParam: {
-        subareaArea: { // 区域分区
+        subareaArea: {
           subareaSn: undefined,
           subareaAreaSn: undefined
         },
-        provinceSn: undefined, // 省
-        citySn: undefined, // 市
-        districtSn: undefined, // 区
-        dealerName: undefined // 经销商名称
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        dealerName: undefined
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
         const params = Object.assign(parameter, this.queryParam)
-        // 获取列表数据 有分页
         return dealerQueryList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            // 计算表格序号
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
@@ -129,8 +125,16 @@ export default {
           return data
         })
       },
-      snObj: undefined, // 经销商sn列表
-      // 列定义
+      basicInfoData: null, //  基本信息
+      productTotal: null,
+      productType: [],
+      snObj: undefined, // 经销商列表
+      warehouseList: [], //  仓库  下拉数据
+      localDataSource: [],
+      isPrice: false, //  仅显示盈亏
+      openPrintModal: false,
+      nowType: null,
+      printerType: 'NEEDLE', //  打印机类型
       columns: [
         { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
         { title: '地区', scopedSlots: { customRender: 'address' }, width: '20%', align: 'center', ellipsis: true },
@@ -143,18 +147,21 @@ export default {
     }
   },
   methods: {
-    // 地区
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
     },
-    // 区域/分区
     subareaChange (val) {
       this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
     },
-    //  重置列表
+    pageInit (data) {
+      this.snObj = data
+      this.queryParam = Object.assign(this.queryParam, data)
+      this.$refs.table.refresh(true)
+    },
+    //  重置
     resetSearchForm () {
       this.queryParam = Object.assign({
         provinceSn: undefined,
@@ -170,7 +177,7 @@ export default {
       this.$refs.subarea.clearData()
       this.$refs.table.refresh(true)
     },
-    //  促销经销商列表导出
+    //  导出
     handleExport () {
       const _this = this
       _this.exportLoading = true
@@ -180,12 +187,6 @@ export default {
         _this.spinning = false
         _this.showExport = true
       })
-    },
-    // 页面初始
-    pageInit (data) {
-      this.snObj = data
-      this.queryParam = Object.assign(this.queryParam, data)
-      this.$refs.table.refresh(true)
     }
   },
   watch: {

+ 192 - 0
src/views/promotionRulesManagement/promotionManagement/productTable.vue

@@ -0,0 +1,192 @@
+<template>
+  <div class="veTableCon">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :row-selection="{ columnWidth: 40 }"
+        @rowSelection="rowSelectionFun"
+        :defaultLoadData="false"
+        :style="{ maxHeight: 300+'px' }"
+        :scroll="{ y:230 }"
+        bordered>
+        <template slot="price" slot-scope="text,record">
+          <a-input-number
+            :min="0"
+            :step="1"
+            :precision="2"
+            :max="99999999"
+            @blur="editAllPrice(record,'price')"
+            placeholder="请输入"
+            :disabled="disabledVal"
+            v-model="record.price"
+            :id="'productTable-price'+record.id "
+            size="small"/>
+        </template>
+        <template slot="ruleValue" slot-scope="text,record">
+          <a-input-number
+            :min="0"
+            :step="1"
+            :precision="2"
+            :max="99999999"
+            :disabled="disabledVal"
+            @blur="editAllPrice(record,'ruleValue')"
+            placeholder="请输入"
+            v-model="record.ruleValue"
+            :id="'productTable-ruleValue'+record.id "
+            size="small"/>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text,record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            :id="'productTable-del-btn'+record.id "
+            :disabled="disabledVal"
+            @click="handleDel(record)"
+          >删除</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </div>
+</template>
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import { promoRuleProductList, deleteBatch, promoUpdateBatch } from '@/api/promoActive'
+export default {
+  name: 'ProductTable',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    promoActiveSn: {
+      type: String,
+      default: ''
+    },
+    disabledVal: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      rowSelectionInfo: null,
+      queryParam: {},
+      dataListQty: '0',
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动价', scopedSlots: { customRender: 'price' }, width: '10%', align: 'right' },
+        { title: '返券金额', scopedSlots: { customRender: 'ruleValue' }, width: '10%', align: 'right' },
+        { title: '参考终端价', dataIndex: 'terminalPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        params.promoActiveSn = this.promoActiveSn
+        return promoRuleProductList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              if (!data.list[i].price) {
+                data.list[i].price = data.list[i].terminalPrice
+              } else {
+                data.list[i].price = data.list[i].price
+              }
+            }
+            this.disabled = false
+            this.dataListQty = res.data.count
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量修改价格
+    editAllPrice (row, typeName) {
+      let ajaxData = []
+      if (typeName != 'all') {
+        ajaxData.push({
+          id: row.id,
+          price: typeName === 'price' ? row.price : undefined,
+          ruleValue: typeName === 'ruleValue' ? row.ruleValue : undefined
+        })
+      } else {
+        ajaxData = row || []
+      }
+      promoUpdateBatch(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+          this.$refs.table.clearSelected() // 清空表格选中项
+        }
+      })
+    },
+    editMorePrice (numInfo) {
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length === 0)) {
+        this.$message.warning('请选择要修改的产品!')
+        return
+      }
+      const ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, ruleValue: numInfo } })
+      this.editAllPrice(ajaxArr, 'all')
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      _this.spinning = true
+      deleteBatch([row.id]).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    getDataNum () {
+      return this.dataListQty
+    },
+    pageInit () {
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    }
+  },
+  mounted () {
+    this.pageInit()
+  },
+  activated () {
+    this.pageInit()
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style>
+ /* form input[type='radio'], form input[type='checkbox'] {
+      width: 15px;
+      height: 14px;
+  } */
+</style>

+ 2 - 2
src/views/promotionRulesManagement/promotionManagement/promotionDescModal.vue

@@ -27,14 +27,14 @@ export default {
       type: Boolean,
       default: false
     },
-    con: { // 促销描述
+    con: {
       type: String,
       default: ''
     }
   },
   data () {
     return {
-      modalTit: '促销描述', // 弹窗标题
+      modalTit: '促销描述',
       isShow: this.openModal //  是否打开弹框
     }
   },

+ 13 - 15
src/views/promotionRulesManagement/promotionManagement/promotionShowModal.vue

@@ -1,26 +1,25 @@
 <template>
   <a-modal
     centered
-    class="promotionShow-modal"
-    id="promotionShow-modal"
+    class="promotionDesc-modal"
     :footer="null"
     :maskClosable="false"
     :title="modalTit"
     v-model="isShow"
     @cancel="isShow=false"
     :width="500">
-    <div class="promotionShow-con">
+    <div class="promotionDesc-con">
       <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
-      <div class="promotionShowCon" v-if="showType==='IMAGE_CONTENT'" v-html="mainContent"></div>
-      <div class="promotionShowCon" v-if="showType=='VIDEO'" >
+      <div class="promotionDescCon" v-if="showType==='IMAGE_CONTENT'" v-html="mainContent"></div>
+      <div class="promotionDescCon" v-if="showType=='VIDEO'" >
         <video width="100%" height="auto" controls loop controlsList="nodownload">
           <source :src="mainContent" type="video/mp4"></source>
         </video>
       </div>
     </div>
     <div class="btn-cont">
-      <!-- <a-button id="promotionShow-modal-back" @click="isShow = false" style="margin-right:10px;">下载图片</a-button> -->
-      <a-button id="promotionShow-modal-back" @click="isShow = false">关闭</a-button>
+      <!-- <a-button id="promotionDesc-modal-back" @click="isShow = false" style="margin-right:10px;">下载图片</a-button> -->
+      <a-button id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
     </div>
   </a-modal>
 </template>
@@ -28,7 +27,7 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 export default {
-  name: 'PromotionShowModal',
+  name: 'PromotionDescModal',
   mixins: [commonMixin],
   props: {
     openModal: { //  弹框显示状态
@@ -38,14 +37,13 @@ export default {
   },
   data () {
     return {
-      modalTit: '促销展示', // 标题
+      modalTit: '促销展示',
       isShow: this.openModal, //  是否打开弹框
       mainContent: '', // 主要显示内容
-      showType: undefined // 显示类型,图片、视频
+      showType: undefined//
     }
   },
   methods: {
-    // 初始化
     pageInit (con) {
       this.showType = con.type
       this.mainContent = con.con
@@ -67,12 +65,12 @@ export default {
 </script>
 
 <style lang="less" scoped>
-  .promotionShow-modal{
+  .promotionDesc-modal{
     /deep/.ant-modal-body{
        text-algin:center !important;
     }
 
-    .promotionShow-con{
+    .promotionDesc-con{
       width:340px;
       margin:0 auto;
       position:relative;
@@ -81,7 +79,7 @@ export default {
          width:81%;
          height:auto;
        }
-       .promotionShowCon{
+       .promotionDescCon{
          position: absolute;
          left:15%;
          top:12.5%;
@@ -91,7 +89,7 @@ export default {
          scrollbar-width:none;
          -ms-overflow-style: none;
        }
-       .promotionShowCon::-webkit-scrollbar{
+       .promotionDescCon::-webkit-scrollbar{
            display:none;
        }
     }