Bladeren bron

Merge commit 'b0d69b1cbfb8b102cdcfd718d8aa5e97b3fd73d6' into HEAD

gitadmin 8 maanden geleden
bovenliggende
commit
97f4f9089a

+ 1 - 1
public/version.json

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

+ 71 - 0
src/api/shopBanner.js

@@ -0,0 +1,71 @@
+import { axios } from '@/utils/request'
+
+//  首页轮播图列表  有分页
+export const shopBannerList = (params) => {
+  const url = `/shopBanner/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+//  首页轮播图  保存
+export const saveShopBanner = (params) => {
+  return axios({
+    url: '/shopBanner/saveShopBanner',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 查看参与经销商
+export const shopBannerSeeDealer = (params) => {
+  const url = `/shopBanner/queryDealerPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 发布  关闭  删除
+export const updateShopBanner = (params) => {
+  return axios({
+    url: '/shopBanner/updateShopBannerState',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 查看详情
+export const shopBannerDetail = (params) => {
+  return axios({
+    url: '/shopBanner/view',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 查看经销商  导出
+export const shopBannerExport = params => {
+  return axios.request({
+    url: '/shopBanner/exportList',
+    method: 'post',
+    data: params,
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出')
+    }
+  })
+}

+ 139 - 0
src/api/shopPromo.js

@@ -0,0 +1,139 @@
+import { axios } from '@/utils/request'
+
+// 促销活动  有分页
+export const shopPromoActiveList = (params) => {
+  const url = `/shopPromo/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 促销活动 详情
+export const shopPromoDetail = params => {
+  return axios({
+    url: `/shopPromo/findBySn/${params.sn}`,
+    data: {},
+    method: 'get',
+    headers: {
+      'module': encodeURIComponent('详情')
+    }
+  })
+}
+
+// 促销活动  删除
+export const shopPromoDel = (params) => {
+  return axios({
+    url: '/shopPromo/delete',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 促销活动  发布
+export const shopPromoRelease = (params) => {
+  return axios({
+    url: '/shopPromo/release',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 促销活动  废弃
+export const shopPromoDiscard = (params) => {
+  return axios({
+    url: '/shopPromo/discard',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 促销活动 修改商城轮播图
+export const updateShopBanner = (params) => {
+  return axios({
+    url: '/shopPromo/updateShopBanner',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  促销活动  保存
+export const saveShopPromo = (params) => {
+  return axios({
+    url: '/shopPromo/save',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 选择产品 获取已选产品列表  有分页
+export const chooseProductList = (params) => {
+  const url = `/shopPromoProduct/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 选择产品 获取选择产品列表 有分页
+export const shopPromoProductList = (params) => {
+  const url = `/shopPromoProduct/queryWaitSelectPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('列表查询')
+    }
+  })
+}
+
+// 选择产品 批量添加产品
+export const saveChooseProduct = (params) => {
+  return axios({
+    url: '/shopPromoProduct/createBatch',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 选择产品  批量修改产品
+export const modifyChooseProduct = (params) => {
+  return axios({
+    url: '/shopPromoProduct/modifyBatch',
+    data: params,
+    method: 'post'
+  })
+}
+
+//  选择产品  删除
+export const delChooseProduct = (params) => {
+  return axios({
+    url: '/shopPromoProduct/modifyDelete',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 产品选择 清空已选产品
+export const clearByPromoSn = (params) => {
+  return axios({
+    url: '/shopPromoProduct/clearByPromoSn',
+    data: params,
+    method: 'post'
+  })
+}

+ 25 - 16
src/components/Select/index.js

@@ -14,7 +14,8 @@ export default {
   data () {
     return {
       dataList: [],
-      placeholderText: ''
+      placeholderText: '',
+      origDataList: []
     }
   },
   props: Object.assign({}, Select.props, {
@@ -32,27 +33,20 @@ export default {
     },
     notIn: {
       type: Array,
-      default: function(){
+      default: function () {
         return []
       }
     }
   }),
   created () {
-    const _this = this
-    // console.log(_this.code, '_this.code')
-    getLookUpData({
-      pageNo: 1,
-      pageSize: 1000,
-      lookupCode: _this.code,
-      isEnable: _this.isEnable ? 1 : undefined
-    }).then(res => {
-      if (res.status == 200) {
-        _this.dataList = res.data.list.filter(item => _this.notIn.indexOf(item.code)<0)
-      }
-    })
+    this.getDataList()
+  },
+  watch: {
+    notIn (newVal, oldVal) {
+      this.getDataList()
+    }
   },
   methods: {
-
     /**
      * 获取当前所有的option 数据
      * @returns options data
@@ -60,6 +54,21 @@ export default {
     getOptionDatas () {
       return _.cloneDeep(this.dataList)
     },
+    getDataList () {
+      const _this = this
+      // console.log(_this.code, '_this.code')
+      getLookUpData({
+        pageNo: 1,
+        pageSize: 1000,
+        lookupCode: _this.code,
+        isEnable: _this.isEnable ? 1 : undefined
+      }).then(res => {
+        if (res.status == 200) {
+          _this.origDataList = res.data.list
+          _this.dataList = res.data.list.filter(item => _this.notIn.indexOf(item.code) < 0)
+        }
+      })
+    },
     // 根据code 获取名称
     getNameByCode (code) {
       const a = this.dataList.find(item => {
@@ -95,7 +104,7 @@ export default {
         this.$emit('change', obj.target.value, _.find(this.dataList, ['code', obj.target.value]))
       }
     }
-    if(this.showType === 'radio'){
+    if (this.showType === 'radio') {
       return (
         <a-radio-group vModel={props.value} {...{ props, on: radioOn }} >
           {

+ 117 - 19
src/config/router.config.js

@@ -3514,6 +3514,53 @@ export const asyncRouterMap = [
               }
             ]
           }
+          // {
+          //   path: '/promotionRulesManagement/promotionManagement',
+          //   redirect: '/promotionRulesManagement/promotionManagement/list',
+          //   name: 'promotionManagement',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '修理厂促销',
+          //     icon: 'file-ppt',
+          //     permission: 'M_promotionManagementList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'promotionManagementList',
+          //       component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/promotionManagement/list.vue'),
+          //       meta: {
+          //         title: '修理厂促销列表',
+          //         icon: 'file-ppt',
+          //         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'
+          //       }
+          //     }
+          //   ]
+          // }
         ]
       },
       // 易码通
@@ -3590,48 +3637,99 @@ export const asyncRouterMap = [
             ]
           },
           {
-            path: '/promotionRulesManagement/promotionManagement',
-            redirect: '/promotionRulesManagement/promotionManagement/list',
-            name: 'promotionManagement',
+            path: '/easyPassManagement/promotionalActivities',
+            redirect: '/easyPassManagement/promotionalActivities/list',
+            name: 'promotionalActivities',
             component: BlankLayout,
             meta: {
-              title: '修理厂促销',
+              title: '促销活动',
               icon: 'file-ppt',
-              permission: 'M_promotionManagementList'
+              permission: 'M_promotionalActivities'
             },
             hideChildrenInMenu: true,
             children: [
               {
                 path: 'list',
-                name: 'promotionManagementList',
-                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/promotionManagement/list.vue'),
+                name: 'activityList',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/promotionalActivities/list.vue'),
                 meta: {
-                  title: '修理厂促销列表',
+                  title: '促销活动列表',
                   icon: 'file-ppt',
                   hidden: true,
-                  permission: 'M_promotionManagementList'
+                  permission: 'M_promotionalActivitiesList'
                 }
               },
               {
-                path: 'add/:sn/:pageType',
-                name: 'promotionManagementAdd',
-                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/promotionManagement/edit.vue'),
+                path: 'add/:pageType',
+                name: 'promotionalAddActivity',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/promotionalActivities/edit.vue'),
                 meta: {
-                  title: '新增修理厂促销',
+                  title: '新增促销活动',
                   icon: 'file-ppt',
                   hidden: true,
-                  permission: 'B_promotionManagementAdd'
+                  replaceTab: true,
+                  permission: 'B_promoActivitiesAdd'
                 }
               },
               {
-                path: 'edit/:sn/:pageType',
-                name: 'promotionManagementEdit',
-                component: () => import(/* webpackChunkName: "promotionRulesManagement" */ '@/views/promotionRulesManagement/promotionManagement/edit.vue'),
+                path: 'edit/:pageType/:sn',
+                name: 'promotionalEditActivity',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/promotionalActivities/edit.vue'),
                 meta: {
-                  title: '编辑修理厂促销',
+                  title: '编辑促销活动',
                   icon: 'file-ppt',
                   hidden: true,
-                  permission: 'B_promotionManagementEdit'
+                  replaceTab: true,
+                  permission: 'B_promoActivitiesEdit'
+                }
+              }
+            ]
+          },
+          {
+            path: '/easyPassManagement/homepageCarouselImg',
+            redirect: '/easyPassManagement/homepageCarouselImg/list',
+            name: 'carouselImageList',
+            component: BlankLayout,
+            meta: {
+              title: '首页轮播图',
+              icon: 'file-ppt',
+              permission: 'M_homepageCarouselImg'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'carouselImageList',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/homepageCarouselImg/list.vue'),
+                meta: {
+                  title: '首页轮播图列表',
+                  icon: 'file-ppt',
+                  hidden: true,
+                  permission: 'M_homepageCarouselImgList'
+                }
+              },
+              {
+                path: 'add',
+                name: 'carouselImageAdd',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/homepageCarouselImg/edit.vue'),
+                meta: {
+                  title: '新增轮播图',
+                  icon: 'file-ppt',
+                  hidden: true,
+                  replaceTab: true,
+                  permission: 'B_homepageCarouselAdd'
+                }
+              },
+              {
+                path: 'edit/:sn/:bizType',
+                name: 'carouselImageEdit',
+                component: () => import(/* webpackChunkName: "easyPassManagement" */ '@/views/easyPassManagement/homepageCarouselImg/edit.vue'),
+                meta: {
+                  title: '编辑轮播图',
+                  icon: 'file-ppt',
+                  hidden: true,
+                  replaceTab: true,
+                  permission: 'B_homepageCarouselEdit'
                 }
               }
             ]

+ 260 - 0
src/views/easyPassManagement/homepageCarouselImg/chooseDealer.vue

@@ -0,0 +1,260 @@
+<template>
+  <a-modal
+    title="选择经销商"
+    v-model="isShow"
+    :footer="null"
+    centered
+    class="lookUpCustomers-modal"
+    @cancel="isShow=false"
+    width="60%"
+  >
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
+        <a-form id="chooseDealer-form" layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="8" :sm="24">
+              <a-form-item label="经销商名称/别名">
+                <a-input id="chooseDealer-nameLike" v-model.trim="queryParam.nameLike" allowClear placeholder="请输入经销商名称/别名"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="商户类型">
+                <dealerType id="chooseDealer-dealerType" changeOnSelect v-model="dealerType" @change="getDealerType" allowClear></dealertype>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-model-item label="商户级别" prop="dealerLevel">
+                <v-select
+                  id="chooseDealer-dealerLevel"
+                  code="DEALER_LEVEL"
+                  v-model="queryParam.dealerLevel"
+                  allowClear
+                  placeholder="请选择商户级别"></v-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="所在区域/分区">
+                <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-button type="primary" @click="searchForm" :disabled="disabled" id="chooseDealer-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="chooseDealer-reset">重置</a-button>
+            </a-col>
+          </a-row>
+        </a-form>
+        <!-- 列表 -->
+        <div style="margin-bottom: 10px">
+          <a-button type="primary" ghost id="chooseDealer-add-btn" :loading="loading" @click="handleBatchAudit">批量添加</a-button>
+          <span style="margin-left: 5px">
+            <template v-if="selectCount"> {{ `已选 ${selectCount} 项` }} </template>
+          </span>
+        </div>
+      </div>
+      <a-table
+        style="height: 320px;"
+        :scroll="{ y: 230 }"
+        :bordered="true"
+        :pagination="pagination"
+        :row-key="record => record.dealerSn"
+        :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+        :columns="columns"
+        :data-source="dealerList"
+        @change="handlePage"
+      >
+        <template slot="addressInfo" slot-scope="text, record">
+          {{ record.provinceName }}{{ '-'+ record.cityName }}{{ '-'+ record.districtName }}
+        </template>
+      </a-table>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable, VSelect } from '@/components'
+import AreaList from '@/views/common/areaList.js'
+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: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    chooseInfo: {// 已选经销商列表
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 批量添加loading
+      dealerType: [], // 商户类型
+      //  查询条件
+      queryParam: {
+        nameLike: '', // 经销商名称/别名
+        dealerType1: undefined, //  商户类型
+        dealerType2: undefined, //  商户类型
+        dealerLevel: null, // 商户级别
+        subareaArea: {
+          subareaSn: undefined, //  区域
+          subareaAreaSn: undefined // 分区
+        }
+      },
+      selectedRowKeys: [], // 已选活动数据
+      dealerList: [], // 经销商列表数据
+      rowSelectionInfo: null,
+      columns: [
+        { title: '经销商名称', dataIndex: 'dealerName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '25%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'dealerTypeName', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { 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 || '--' } }
+      ],
+      // 分页
+      pagination: {
+        pageSize: 20,
+        showSizeChanger: true,
+        pageSizeOptions: ['20', '50', '100', '200', '500']
+      },
+      pageFlag: false
+    }
+  },
+  computed: {
+    // 计算选择活动条数
+    selectCount () {
+      return this.selectedRowKeys && this.selectedRowKeys.length
+    }
+  },
+  methods: {
+    // 已选活动数据
+    onSelectChange (selectedRowKeys) {
+      this.selectedRowKeys = selectedRowKeys
+    },
+    // 分页
+    handlePage (pagination, filters, sorter) {
+      const pager = { ...this.pagination }
+      pager.pageNo = pagination.pageSize != pager.pageSize ? 1 : pagination.current
+      pager.pageSize = pagination.pageSize
+      pager.current = pager.pageNo
+      this.pagination = pager
+      this.loadData()
+    },
+    // 获取列表数据
+    loadData () {
+      this.spinning = true
+      const params = { pageSize: 20, pageNo: 1, ...this.pagination }
+      dealerQueryList(Object.assign(params, this.queryParam)).then(res => {
+        let data
+        if (res.status == 200) {
+          data = res.data
+          const pagination = { ...this.pagination }
+          pagination.total = data.count
+          const no = 0
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = no + i + 1
+            if (data.list[i].dealerTypeName1) {
+              data.list[i].dealerTypeName = data.list[i].dealerTypeName1 + '>' + data.list[i].dealerTypeName2
+            }
+          }
+          this.dealerList = data.list
+          this.pagination = pagination
+          if (this.chooseInfo.length > 0 && !this.pageFlag) {
+            this.pageFlag = true
+            this.selectedRowKeys = this.chooseInfo
+          }
+        }
+        this.spinning = false
+      })
+    },
+    // 表格选中项
+    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()
+    },
+    // 区域分区
+    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 = {
+        nameLike: '', // 经销商名称/别名
+        dealerType1: undefined, //  商户类型
+        dealerType2: undefined, //  商户类型
+        dealerLevel: null, // 商户级别
+        subareaArea: {
+          subareaSn: undefined, //  区域
+          subareaAreaSn: undefined // 分区
+        }
+      }
+      this.dealerType = []
+      this.$refs.subarea.clearData()
+      this.pagination.pageNo = 1
+      this.pagination.current = 1
+      this.loadData()
+      this.pageFlag = false
+      this.selectedRowKeys = []
+    },
+    // 批量添加
+    async handleBatchAudit () {
+      const _this = this
+      if (_this.selectedRowKeys && _this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      this.spinning = true
+      const dealerInfoList = await getDealerListInfo({ dealerSnList: _this.selectedRowKeys })
+      this.spinning = false
+      this.$emit('ok', dealerInfoList.data)
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.$nextTick(() => {
+          this.resetSearchForm()
+        })
+      }
+    }
+  }
+}
+</script>

+ 269 - 0
src/views/easyPassManagement/homepageCarouselImg/detailModal.vue

@@ -0,0 +1,269 @@
+<template>
+  <a-modal
+    centered
+    class="promotion-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="详情"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="60%">
+    <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="bannerName">
+            {{ form.bannerName }}
+          </a-form-model-item>
+          <a-form-model-item label="轮播时间" prop="time" >
+            {{ form.bannerStartDate }}~{{ form.bannerEndDate }}
+          </a-form-model-item>
+          <a-form-model-item label="轮播图排序" prop="sort">
+            {{ form.sort }}
+          </a-form-model-item>
+          <a-form-model-item label="参与经销商" prop="allDealerFlag">
+            <span>{{ form.allDealerFlag=='1'?'全部经销商':'部分经销商' }}</span>
+            <div class="buyerBox" v-if="form.dealerList&&form.dealerList.length>0">
+              <a-tag v-for="con in form.dealerList" id="promotionList-dealerSn" :key="con.dealerSn" @close="delBuyerName(con)">
+                {{ con.dealerName }}
+              </a-tag>
+            </div>
+          </a-form-model-item>
+          <a-form-model-item label="封面图片" prop="imageUrl">
+            <img
+              :src="form.imageUrl"
+              alt="图片走丢了"
+              width="80"
+              height="80"
+              style="margin-right:10px;object-fit: cover;"/>
+            <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'?'视频展示':form.contentType==='LINK'?'跳转链接':'促销活动' }}
+          </a-form-model-item>
+          <a-form-model-item label="内容" prop="content" v-if="form.contentType!='PROMO_LINK'">
+            <div style="border:1px solid #efefef;border-radius:8px;padding:10px 20px;" v-if="form.contentType==='IMAGE_CONTENT'" v-html="form.content"></div>
+            <div v-else-if="form.contentType==='VIDEO'">
+              <video
+                ref="videoPlayer"
+                width="230"
+                height="150"
+                controls
+                loop
+                controlsList="nodownload">
+                <source :src="form.content" type="video/mp4">
+              </video>
+            </div>
+            <div v-else>{{ form.content }}</div>
+          </a-form-model-item>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button id="promotion-basicInfo-modal-close" @click="isShow = false">关闭</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable } from '@/components'
+// 接口
+import { shopBannerDetail } from '@/api/shopBanner'
+
+export default {
+  name: 'DetailModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {// 活动sn
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      // form表单label布局
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      productTypeList: [], // 产品范围数据
+      productRangeList: [], // 已选产品范围
+      chooseDealerList: [{}, {}],
+      form: {
+        bannerSn: undefined, // 轮播图sn
+        bannerName: '', // 轮播图名称
+        time: [], // 轮播时间
+        bannerStartDate: undefined,
+        bannerEndDate: undefined,
+        sort: undefined, // 排序
+        allDealerFlag: '1', // 参与经销商 0 部分 1全部
+        dealerSnList: [], // 已选经销商sn列表
+        imageUrl: '', // 图片
+        contentType: 'IMAGE_CONTENT', // 内容类型
+        content: '' // 内容
+      },
+      // 表单验证规则
+      rules: {
+        bannerName: [{ required: true, message: '请输入轮播图名称', trigger: 'blur' }],
+        time: [{ required: true, message: '请选择轮播时间', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
+        imageUrl: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
+        content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }]
+      }
+    }
+  },
+  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 () {
+      shopBannerDetail({ bannerSn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.form = res.data
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    },
+    itemSn (newValue, oldValue) { // 查看详情
+      if (this.isShow && newValue) {
+        this.getDetail()
+      }
+    }
+  }
+}
+</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:10px 0 20px;
+      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>

+ 506 - 0
src/views/easyPassManagement/homepageCarouselImg/edit.vue

@@ -0,0 +1,506 @@
+<template>
+  <div class="carouselImageEdit-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-page-header :ghost="false" :backIcon="false" class="carouselImageEdit-cont" >
+        <!-- 自定义的二级文字标题 -->
+        <template slot="subTitle">
+          <a id="carouselImageEdit-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" />返回列表</a>
+          <span v-if="$route.params.sn" style="margin: 0 10px 0 20px;color: #666;font-size: 14px;font-weight: 600;">促销名称:{{ form.bannerName||'--' }}</span>
+        </template>
+      </a-page-header>
+      <!-- 表单 -->
+      <a-card :bordered="false" class="carouselImageEdit-cont">
+        <a-form-model
+          id="carouselImageEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-row>
+            <a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="轮播图名称" prop="bannerName" :label-col="{span:4}" :wrapper-col="{span:16}">
+                <a-input
+                  id="carouselImageEdit-bannerName"
+                  :maxLength="30"
+                  :disabled="isDisabled"
+                  v-model.trim="form.bannerName"
+                  placeholder="请输入轮播图名称(最多30个字符)"
+                  allowClear/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="轮播时间" prop="time" :label-col="{span:4}" :wrapper-col="{span:16}">
+                <a-range-picker
+                  v-model="form.time"
+                  style="width:100%"
+                  :format="dateFormat"
+                  id="carouselImageEdit-time"
+                  @change="dateChange"
+                  :disabled="isDisabled"
+                  :disabled-date="disabledDate"
+                  :placeholder="['开始时间', '结束时间']" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="轮播图排序" prop="sort">
+                <a-input-number
+                  style="width:40%"
+                  id="carouselImageEdit-sort"
+                  allowClear
+                  placeholder="请输入轮播图排序数字(数字越大越靠后)"
+                  v-model="form.sort"
+                  :min="0"
+                  :max="99999999"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="参与经销商" prop="allDealerFlag">
+                <a-row :gutter="15">
+                  <a-col :md="10" :sm="24">
+                    <a-select
+                      style="width:98%;"
+                      id="carouselImageEdit-allDealerFlag"
+                      v-model="form.allDealerFlag"
+                      placeholder="请选择参与经销商"
+                      @change="changeDealerScope"
+                      :disabled="isDisabled"
+                      allowClear>
+                      <a-select-option id="promotionList-dealerScope-all" value="1">全部经销商</a-select-option>
+                      <a-select-option id="promotionList-dealerScope-some" value="0">部分经销商</a-select-option>
+                    </a-select>
+                  </a-col>
+                  <a-col :md="2" :sm="24" v-show="form.allDealerFlag && form.allDealerFlag!='1' ">
+                    <a-button id="promotionList-basicInfo-dealerScope" type="primary" :loading="spinning" :disabled="isDisabled" @click="handleDealerModal">选择</a-button>
+                  </a-col>
+                  <a-col :md="5" :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="!isDisabled" v-for="con in chooseDealerList" id="promotionList-dealerSn" :key="con.dealerSn" @close.stop="delBuyerName(con)">
+                        {{ con.dealerName }}
+                      </a-tag>
+                    </div>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="封面图片" prop="imageUrl">
+                <Upload
+                  class="upload"
+                  id="carouselImageEdit-imageUrl"
+                  v-model="form.imageUrl"
+                  ref="imageSet"
+                  :fileSize="10"
+                  :maxNums="1"
+                  @change="changeImage"
+                  listType="picture-card"></Upload>
+                <span class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(750px)*高(300px)</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="carouselImageEdit-contentType"
+                  code="PROMO_CONTENT_TYPE"
+                  showType="radio"
+                  :notIn="notShowSel"
+                  :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="contentEditor" v-show="form.contentType =='IMAGE_CONTENT'">
+                <editor
+                  v-show="!isDisabled"
+                  id="carouselImageEdit-editor"
+                  ref="editor"
+                  class="carouselImageEdit-editor"
+                  @on-change="editorChange"
+                  :cache="false"></editor>
+                <div style="border:1px solid #efefef;border-radius:8px;padding:10px 20px;" v-if="isDisabled" v-html="form.content"></div>
+              </a-form-model-item>
+              <a-form-model-item label="上传视频" prop="content" v-show="form.contentType =='VIDEO'">
+                <Upload
+                  class="upload"
+                  id="carouselImageEdit-videoSet"
+                  v-model="form.content"
+                  fileType="video/mp4"
+                  ref="videoSet"
+                  :disabled="isDisabled"
+                  :fileSize="100"
+                  :maxNums="1"
+                  @change="changeVideo"
+                ></Upload>
+                <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="isDisabled"
+                  id="carouselImageEdit-contentLink"
+                  :maxLength="100"
+                  v-model.trim="form.contentLink"
+                  placeholder="请输入跳转链接"
+                  allowClear />
+              </a-form-model-item>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </a-card>
+    </a-spin>
+    <div class="affix-cont">
+      <a-button
+        type="primary"
+        class="button-primary"
+        :disabled="spinning"
+        id="carouselImageEdit-submit-btn"
+        size="large"
+        @click="handleSave('all')"
+        style="padding: 0 60px;">保存</a-button>
+    </div>
+    <!-- 选择经销商 -->
+    <chooseDealer :openModal="openDealerModal" :chooseInfo="chooseSnList" @close="closeDealerModal" @ok="addDealerOk"></chooseDealer>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+// 组件
+import { VSelect, Upload } from '@/components'
+import Editor from '@/components/WEeditor'
+import chooseDealer from './chooseDealer'
+// 接口
+import { saveShopBanner, shopBannerDetail } from '@/api/shopBanner'
+
+export default {
+  name: 'CarouselImageEdit',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, Editor, chooseDealer },
+  data () {
+    return {
+      spinning: false,
+      // 表单 label 设置
+      formItemLayout: {
+        labelCol: { span: 2 },
+        wrapperCol: { span: 20 }
+      },
+      chooseDealerList: [], // 已选经销商数据
+      openDealerModal: false, // 打开选择经销商弹窗
+      isDisabled: false,
+      // 链接配置内容
+      form: {
+        bannerSn: undefined, // 轮播图sn
+        bannerName: '', // 轮播图名称
+        time: [], // 轮播时间
+        bannerStartDate: undefined,
+        bannerEndDate: undefined,
+        sort: undefined, // 排序
+        allDealerFlag: '1', // 参与经销商 0 部分 1全部
+        dealerSnList: [], // 已选经销商sn列表
+        imageUrl: '', // 图片
+        contentType: 'LINK', // 内容类型
+        content: '', // 内容
+        contentLink: '', // 内容链接
+        state: 'UNPUBLISH', // 发布状态
+        contentEditor: ''
+      },
+      chooseSnList: [],
+      dateFormat: 'YYYY-MM-DD', // 有效期时间格式
+      notShowSel: ['PROMO_LINK'], // 是否显示促销活动选择按钮
+      // 表单验证规则
+      rules: {
+        bannerName: [{ required: true, message: '请输入轮播图名称', trigger: 'blur' }],
+        time: [{ required: true, message: '请选择轮播时间', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
+        imageUrl: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
+        content: [{ required: true, message: '请选择视频展示', trigger: ['blur', 'change'] }],
+        contentLink: [{ required: true, message: '请输入跳转链接', trigger: ['blur', 'change'] }],
+        contentEditor: [{ required: true, message: '请输入图文内容', trigger: ['blur', 'change'] }]
+      }
+    }
+  },
+  methods: {
+    // 部分经销商  选择经销商成功
+    addDealerOk (list) {
+      this.chooseDealerList = list
+      this.openDealerModal = false
+    },
+    // 禁用日期时间
+    disabledDate (current) {
+      return current && current < moment().startOf('day')
+    },
+    // 轮播时间
+    dateChange (date, dateString) {
+      this.form.time = date
+      if (dateString[0] != '' && dateString[1] != '') {
+        this.form.bannerStartDate = dateString[0] + ' 00:00:00'
+        this.form.bannerEndDate = dateString[1] + ' 23:59:59'
+      }
+    },
+    // 打开 选择经销商弹窗
+    handleDealerModal () {
+      this.chooseSnList = this.chooseDealerList.map(item => item.dealerSn)
+      this.openDealerModal = true
+    },
+    // 关闭 选择经销商弹窗
+    closeDealerModal () {
+      this.chooseSnList = []
+      this.openDealerModal = false
+    },
+    // 切换类型  清空内容显示
+    changeContentType (val) {
+      this.form.content = ''
+      this.form.contentLink = ''
+    },
+    // 部分经销商 删除
+    delBuyerName (row) {
+      const pos = this.chooseDealerList.findIndex(item => item.dealerSn == row.dealerSn)
+      if (pos >= 0) {
+        this.chooseDealerList.splice(pos, 1)
+      }
+    },
+    // 参与经销商 change
+    changeDealerScope (val) {
+      this.form.allDealerFlag = val
+      if (val == '1') {
+        this.chooseDealerList = []
+      }
+    },
+    // 返回列表
+    handleBack () {
+      this.$router.push({ name: 'carouselImageList', query: { closeLastOldTab: true } })
+    },
+    //  详情
+    getDetail () {
+      const _this = this
+      shopBannerDetail({ bannerSn: this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          if (res.data.bizType && res.data.bizType === 'SHOP_PROMO') {
+            _this.isDisabled = true
+          }
+          _this.form = { ..._this.form, ...res.data }
+          _this.$nextTick(() => {
+            if (res.data.contentType == 'IMAGE_CONTENT') {
+              _this.$refs.editor.setHtml(res.data.content)
+            } else if (res.data.contentType == 'VIDEO') {
+              _this.$refs.videoSet.setFileList(res.data.content)
+            } else if (res.data.contentType == 'LINK') {
+              res.data.contentLink = res.data.content
+            }
+            if (res.data.allDealerFlag == '0') {
+              this.chooseDealerList = res.data.dealerList
+            }
+            _this.$refs.imageSet.setFileList(res.data.imageUrl)
+            _this.form.contentEditor = res.data.content
+            _this.form.time = [res.data.bannerStartDate, res.data.bannerEndDate]
+          })
+          console.log('22222222222222:', _this.form)
+        }
+      })
+    },
+    //  确定保存  验证必填
+    handleSave (type) {
+      const _this = this
+      if (_this.form.contentType === 'LINK') {
+        _this.form.content = _this.form.contentLink
+      }
+      if (_this.form.contentType === 'IMAGE_CONTENT') {
+        _this.form.content = _this.form.contentEditor
+      }
+      console.log('11111111111:', _this.form)
+      // 验证组件必填项
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.savePartInfo(type)
+        }
+      })
+    },
+    // 保存
+    savePartInfo (type) {
+      const _this = this
+      if (_this.form.allDealerFlag == '0') {
+        if (_this.chooseDealerList && _this.chooseDealerList.length == 0) {
+          _this.$message.warning('请选择参与经销商!')
+          return
+        }
+        _this.form.dealerSnList = _this.chooseDealerList.map(con => con.dealerSn)
+      }
+      _this.form.bannerSn = _this.$route.params.sn || undefined
+      var formData = JSON.parse(JSON.stringify(_this.form))
+      delete formData.time
+      delete formData.contentLink
+      delete formData.contentEditor
+      _this.spinning = true
+      saveShopBanner(formData).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$nextTick(() => {
+            _this.handleBack()
+          })
+          _this.resetSearchForm()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  图片上传
+    changeImage (file) {
+      this.form.imageUrl = file
+    },
+    // 视频上传
+    changeVideo (file) {
+      this.form.content = file
+    },
+    //  文本编辑器
+    editorChange (html, text) {
+      this.form.contentEditor = html
+      if (html) {
+        this.$refs.ruleForm.clearValidate('contentEditor')
+      }
+    },
+    // 重置
+    resetSearchForm () {
+      this.form = {
+        bannerSn: undefined, // 轮播图sn
+        bannerName: '', // 轮播图名称
+        time: [], // 轮播时间
+        bannerStartDate: undefined, // 轮播图活动开始时间
+        bannerEndDate: undefined, // 轮播图活动结束时间
+        sort: undefined, // 排序
+        allDealerFlag: '1', // 参与经销商 0 部分 1全部
+        dealerSnList: [], // 已选经销商sn列表
+        imageUrl: '', // 图片
+        contentType: 'LINK', // 内容类型
+        content: '', // 内容
+        contentLink: '',
+        state: 'UNPUBLISH',
+        contentEditor: ''
+      }
+      if (this.$refs.imageSet) {
+        this.$refs.imageSet.setFileList('')
+      }
+      if (this.form.contentType === 'VIDEO' && this.$refs.videoSet) {
+        this.$refs.videoSet.setFileList('')
+      }
+      if (this.form.contentType === 'IMAGE_CONTENT') {
+        this.$refs.editor.setHtml('')
+      }
+      this.isDisabled = false
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields()
+      }
+    },
+    // 初始化
+    pageInit () {
+      if (this.$route.params.sn) {
+        this.getDetail()
+        if (this.$route.params.bizType && this.$route.params.bizType === 'SHOP_PROMO') {
+          this.notShowSel.splice(0, 1)
+        }
+      }
+    }
+  },
+  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>
+.carouselImageEdit-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;
+    }
+    .carouselImageEdit-cont{
+      margin-bottom: 10px;
+    }
+    .upload{
+      width: 100%!important;
+    }
+    //  文本编辑器  工具栏样式换行
+    .carouselImageEdit-editor{
+      .w-e-toolbar{
+        flex-wrap: wrap;
+        z-index: 0;
+      }
+    }
+    .buyerBox{
+      border:1px solid #d9d9d9;
+      margin-top:10px;
+      border-radius:4px;padding:4px 10px;
+      background:#f2f2f2;max-height:130px;
+      overflow-y:scroll;
+    }
+    //  商品图片描述
+    .upload-desc{
+      font-size: 12px;
+      color: #808695;
+    }
+    #carouselImageEdit-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>

+ 314 - 0
src/views/easyPassManagement/homepageCarouselImg/list.vue

@@ -0,0 +1,314 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="carouselImage-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" id="carouselImage-form" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建时间">
+                <rangeDate id="carouselImage-createDate" ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="轮播图名称">
+                <a-input id="carouselImage-bannerName" v-model.trim="queryParam.bannerName" allowClear placeholder="请输入轮播图名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="轮播图状态">
+                <v-select
+                  v-model="queryParam.state"
+                  ref="stateDictValue"
+                  id="carouselImage-state"
+                  code="SHOP_BANNER_STATE"
+                  placeholder="请选择轮播图状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" id="carouselImage-refresh" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" id="carouselImage-reset" @click="resetSearchForm()">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    <!-- 列表 -->
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮 -->
+        <div class="table-operator" v-if="$hasPermissions('B_homepageCarouselAdd')">
+          <a-button type="primary" id="carouselImage-add-btn" @click="handleAddOrEdit()">新增</a-button>
+        </div>
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 促销时间 -->
+          <template slot="promotionTime" slot-scope="text, record">
+            <span>{{ record.bannerStartDate }}至{{ record.bannerEndDate }}</span>
+          </template>
+          <!-- 参与经销商 -->
+          <template slot="joinCustomers" slot-scope="text, record">
+            <span class="customerBox" v-if="$hasPermissions('B_homepageCarouselSee')&&(record.allDealerFlag&&record.allDealerFlag=='0')" @click="handleCustomers(record)" :id="'carouselImage-seeDealerInfo-'+record.id">共有<span class="link-bule">{{ record.dealerQty }}</span>个客户</span>
+            <span v-else-if="!$hasPermissions('B_homepageCarouselSee')&&(record.allDealerFlag&&record.allDealerFlag=='0')">共有<span class="link-bule">{{ record.dealerQty }}</span>个客户</span>
+            <span v-else-if="$hasPermissions('B_homepageCarouselSee')&&(record.allDealerFlag&&record.allDealerFlag=='1')">全部经销商</span>
+            <span v-else>--</span>
+          </template>
+          <!-- 封面展示 -->
+          <template slot="salesShow" slot-scope="text, record">
+            <div v-if="record.imageUrl" @click="handleCheckImg(record)" :id="'carouselImage-seeImgInfo-'+record.id">
+              <img :src="record.imageUrl" alt="图片走丢啦" width="60"/>
+            </div>
+            <span v-else>--</span>
+          </template>
+          <!-- 操作 -->
+          <!-- state状态 END已结束    CLOSE已关闭    PUBLISH  已发布    UNPUBLISH  未发布 -->
+          <template slot="action" slot-scope="text, record">
+            <a-button
+              size="small"
+              type="link"
+              class="button-warning"
+              :id="'carouselImage-edit-btn-'+record.id"
+              @click="handleAddOrEdit(record)"
+              v-if="(record.state=='UNPUBLISH' || record.state=='CLOSE') && $hasPermissions('B_homepageCarouselEdit')">编辑</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-success"
+              @click="handleSee(record)"
+              v-if="(record.state=='PUBLISH' || record.state=='END')&&$hasPermissions('B_homepageCarouselDetail')"
+              :id="'carouselImage-seeDetail-btn-'+record.id">查看</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              @click="closeReleaseDel(record,'PUBLISH')"
+              v-if="(record.state=='UNPUBLISH'||record.state=='CLOSE')&&$hasPermissions('B_homepageCarouselRelease')"
+              :id="'carouselImage-release-btn-'+record.id">发布</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-info"
+              @click="closeReleaseDel(record,'CLOSE')"
+              v-if="(record.state=='PUBLISH')&&$hasPermissions('B_homepageCarouselClose')"
+              :id="'carouselImage-release-btn-'+record.id">关闭</a-button>
+            <a-button
+              size="small"
+              type="link"
+              class="button-error"
+              v-if="(record.state=='UNPUBLISH'||record.state=='CLOSE')&&$hasPermissions('B_homepageCarouselDel')"
+              @click="closeReleaseDel(record,'1')"
+              :id="'carouselImage-del-btn-'+record.id">删除</a-button>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 参与经销商 -->
+      <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
+      <!-- 封面展示 -->
+      <imgShowModal v-drag ref="checkedImg" :openModal="openCheckedImgModal" @close="openCheckedImgModal=false"></imgShowModal>
+      <!-- 查看 -->
+      <detail-Modal :openModal="openDetailModal" :itemSn="itemId" @close="closeDetailModal" @ok="openDetailModal=false"/>
+    </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 '@/views/easyPassManagement/promotionalActivities/lookUpCustomersModal'
+import imgShowModal from '@/views/easyPassManagement/shoppingManagement/imgShowModal'
+import detailModal from './detailModal'
+// 接口
+import { shopBannerList, updateShopBanner } from '@/api/shopBanner'
+export default {
+  name: 'PromotionList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rangeDate, lookUpCustomersModal, detailModal, imgShowModal },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      openCustomerModal: false, // 打开参与经销商弹窗
+      openCheckedImgModal: false, // 查看封面图弹窗
+      openDetailModal: false, // 打开详情弹窗
+      itemId: '', // 当前活动sn
+      createDate: [], //  创建时间
+      // 查询参数
+      queryParam: {
+        beginDate: undefined, // 创建开始时间
+        endDate: undefined, // 创建结束时间
+        bannerName: '', // 轮播图名称
+        state: undefined// 轮播图状态
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return shopBannerList(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
+        })
+      },
+      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: 'bannerName', width: '13%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '轮播时间', scopedSlots: { customRender: 'promotionTime' }, width: '13%', align: 'center' },
+        { title: '参与经销商', scopedSlots: { customRender: 'joinCustomers' }, width: '8%', align: 'center' },
+        { title: '封面展示', scopedSlots: { customRender: 'salesShow' }, width: '6%', align: 'center' },
+        { title: '轮播图状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+    }
+  },
+  methods: {
+    // 新增  编辑
+    handleAddOrEdit (row) {
+      if (!row) {
+        this.$router.push({ name: 'carouselImageAdd' })
+      } else {
+        this.$router.push({ name: 'carouselImageEdit', params: { sn: row.bannerSn, bizType: row.bizType || 'none' } })
+      }
+    },
+    //  创建时间  change
+    dateCreateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 参与经销商
+    handleCustomers (row) {
+      this.openCustomerModal = true
+      this.$nextTick(() => {
+        this.$refs.lookUpCustomers.pageInit({ bannerSn: row.bannerSn })
+      })
+    },
+    // 封面图片
+    handleCheckImg (record) {
+      this.openCheckedImgModal = true
+      const _this = this
+      _this.$nextTick(() => {
+        _this.$refs.checkedImg.pageInit(record.imageUrl)
+      })
+    },
+    // 重置
+    resetSearchForm () {
+      this.createDate = []
+      this.$refs.rangeCreateDate.resetDate([])
+      this.queryParam.beginDate = undefined
+      this.queryParam.endDate = undefined
+      this.queryParam.bannerName = ''
+      this.queryParam.state = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 发布  关闭  删除
+    closeReleaseDel (row, val) {
+      const _this = this
+      let tipDetail = null
+      const ajaxData = { bannerSn: row.bannerSn }
+      if (val != '1') {
+        tipDetail = '确认要' + (val === 'CLOSE' ? '关闭' : '发布') + '吗?'
+        ajaxData.state = val
+        ajaxData.delFlag = undefined
+      } else {
+        tipDetail = '点击确定,该内容将会被删除,不可再恢复!'
+        ajaxData.state = undefined
+        ajaxData.isDel = val
+      }
+      this.$confirm({
+        title: '提示',
+        content: tipDetail,
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          updateShopBanner(ajaxData).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 打开详情
+    handleSee (row) {
+      this.openDetailModal = true
+      this.itemId = row.bannerSn
+    },
+    // 关闭详情
+    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
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less" scoped>
+  .customerBox{
+    cursor:pointer;
+  }
+</style>

+ 273 - 0
src/views/easyPassManagement/promotionalActivities/chooseProductsModal.vue

@@ -0,0 +1,273 @@
+<template>
+  <a-drawer
+    title="选择产品"
+    class="chooseProducts-modal"
+    placement="right"
+    closable
+    :visible="isShow"
+    @close="isShow=false"
+    width="70%"
+  >
+    <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-orignCode" v-model.trim="queryParam.productOrigCode" 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 id="chooseProducts-add" :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: this.chooseDataList && this.chooseDataList.indexOf(record.productSn) > -1 } })}"
+          @rowSelection="rowSelectionFun"
+          :columns="columns"
+          :pagination="{pageSizeOptions: ['20','50','100','200','500']}"
+          :data="loadData"
+          :defaultLoadData="false"
+          style="max-height:650px;"
+          :scroll="{ y: 600 }"
+          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 ProductBrand from '@/views/common/productBrand.js'
+import productTypeAll from '@/views/common/productTypeAll.js'
+// 接口
+import { shopPromoProductList } from '@/api/shopPromo'
+
+export default {
+  name: 'ChooseProductsModal',
+  components: { STable, ProductBrand, productTypeAll },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    chooseData: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    const _this = this
+    return {
+      spinning: false,
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, //  表格加载中
+      isShow: this.openModal, //  是否打开弹框
+      // form表单label 布局
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 20 }
+      },
+      //  查询条件
+      queryParam: {
+        productName: '', // 产品名称
+        productCode: '', //  产品编码
+        productOrigCode: '', //  原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productType: [], // 产品分类
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      chooseDataList: [], // 已选择被禁用的数据
+      columns: [
+        { title: '序号', dataIndex: 'no', width: 60, align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', align: 'center' },
+        { title: '产品名称', dataIndex: 'productName', align: 'center', width: '18%', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '商城售价', dataIndex: 'shopProductPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '终端价', dataIndex: 'terminalPrice', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '品牌', dataIndex: 'productBrandName', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
+        { title: '产品分类', scopedSlots: { customRender: 'productType' }, width: '10%', align: 'center' },
+        { title: '包装数', scopedSlots: { customRender: 'productQty' }, align: 'center' },
+        { title: '单位', dataIndex: 'unit', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        // 获取列表数据 有分页
+        return shopPromoProductList(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
+        })
+      },
+      rowSelectionInfo: null// 表格选中项
+    }
+  },
+  computed: {
+    // 计算表格选中条数
+    selectCount () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 重置数据
+    resetData () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.productOrigCode = ''
+      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)
+    },
+    //  产品分类  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] : ''
+    },
+    // 禁用
+    handleDisabled (list) {
+      this.chooseDataList = list
+    }
+  },
+  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()
+        if (_this.chooseData && _this.chooseData.length > 0) {
+          let selectedRows = []
+          const selectedRowKeys = []
+          _this.chooseData.forEach(item => {
+            selectedRowKeys.push(item.goodsSn)
+          })
+          selectedRows = _this.chooseData
+          this.$nextTick(() => { // 页面渲染完成后的回调
+            _this.$refs.table.setTableSelected(selectedRowKeys, selectedRows) // 设置表格选中项
+          })
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseProducts-modal{
+    .products-con{
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 369 - 0
src/views/easyPassManagement/promotionalActivities/detailModal.vue

@@ -0,0 +1,369 @@
+<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-row>
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="促销名称" prop="promoName" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.promoName }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="促销时间" prop="promoName" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.promoStartDate }}~{{ form.promoEndDate }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="排序" prop="sort" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.sort||form.sort==0?form.sort:'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="12" :sm="12">
+              <a-form-model-item label="参与经销商" prop="allDealerFlag" :label-col="{span:8}" :wrapper-col="{span:14}">
+                {{ form.allDealerFlag=='1'?'全部经销商':'部分经销商' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24">
+              <a-form-model-item label="封面图片" prop="imageUrl">
+                <img
+                  :src="form.imageUrl"
+                  alt="图片走丢了"
+                  width="80"
+                  height="80"
+                  style="margin-right:10px;object-fit: cover;"/>
+                <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24">
+              <a-form-model-item label="促销描述" prop="description" >
+                {{ form.description||'--' }}
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24">
+              <a-form-model-item label="加盟商开关权限:" prop="dealerOpenFlag" >
+                {{ form.dealerOpenFlag?form.dealerOpenFlag==='1'?'是':'否':'--' }}
+              </a-form-model-item>
+            </a-col>
+            <div v-if="form.promoType==='BUY_PROD_GIVE_VALID'">
+              <a-col :xs="12" :sm="12">
+                <a-form-model-item label="券名称" prop="validName" :label-col="{span:8}" :wrapper-col="{span:14}">
+                  {{ form.validName }}
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="12" :sm="12">
+                <a-form-model-item label="券副标题" :label-col="{span:8}" :wrapper-col="{span:14}">
+                  {{ form.validTitle ||'--' }}
+                </a-form-model-item>
+              </a-col>
+              <!-- <a-col :xs="24" :sm="24">
+                <a-form-model-item label="生成方式" prop="validBaseType">
+                  {{ form.validBaseTypeDictValue||'--' }}
+                </a-form-model-item>
+              </a-col> -->
+              <a-col :xs="24" :sm="24">
+                <a-form-model-item label="券有效期" prop="validType">
+                  <span>{{ form.validType==='FIXED'?'固定日期':'领取后,立即生效' }}</span>
+                  <span style="margin-left:10px;" v-if="form.validType==='FIXED'">{{ form.validStartDate }}~{{ form.validEndDate }}</span>
+                  <span style="margin-left:10px;" v-else>有效期{{ form.validDays }}天</span>
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24">
+                <a-form-model-item label="券适用范围" prop="validScope">
+                  {{ form.validScope=='1'?'全部产品':'--' }}
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24">
+                <a-form-model-item label="使用说明">
+                  {{ form.validInfo||'--' }}
+                </a-form-model-item>
+              </a-col>
+            </div>
+            <a-col :xs="24" :sm="24">
+              <a-form-model-item :label="form.promoType==='BUY_PROD_GIVE_PROD'?'满赠规则': form.promoType==='PROMO_PROD'?'优惠方式':'返券产品'" prop="promoName" >
+                <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>
+            </a-col>
+          </a-row>
+        </a-form-model>
+        <div class="btn-cont">
+          <a-button id="promotion-basicInfo-modal-close" @click="isShow = false">关闭</a-button>
+        </div>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable } from '@/components'
+// 接口
+import { shopPromoDetail, chooseProductList } from '@/api/shopPromo'
+
+export default {
+  name: 'DetailModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {// 活动sn
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      // form表单label布局
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      productTypeList: [], // 产品范围数据
+      productRangeList: [], // 已选产品范围
+      form: {
+        promoType: undefined, // 促销类型
+        promoName: '', // '促销名称'
+        time: [], // 促销时间
+        promoStartDate: undefined, // 促销时间-开始
+        promoEndDate: undefined, // 促销时间-结束
+        sort: undefined, // 排序
+        allDealerFlag: '1', // 全部经销商 1   部分经销商0'
+        imageUrl: undefined, // 促销封面图
+        description: '', // '促销描述'
+        dealerEditFlag: '0', // 加盟商编辑 0否 1是
+        dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
+        rangeList: [], // 选择产品列表
+        discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
+        validName: '', // 券名称
+        validTitle: '', // 券副标题
+        validBaseType: undefined, // 券生成方式
+        validType: undefined, // 券有效期类型
+        validStartDate: undefined, // 券生效时间
+        validEndDate: undefined, // 券失效时间
+        validDays: undefined, // 券有效期天数
+        validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
+        validInfo: '' // 使用说明
+      },
+      // 表单验证规则
+      rules: {
+        promoName: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
+        time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
+        imageUrl: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        description: [{ required: true, message: '请输入促销描述内容', trigger: 'blur' }],
+        dealerOpenFlag: [{ required: true, message: '请选择加盟商开关权限', trigger: 'change' }],
+        rangeList: [{ required: true, message: '请选择促销产品', trigger: 'change' }],
+        validName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
+        validBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
+        validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
+        validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        params.promoSn = this.itemSn
+        // 获取详情  已选参与活动产品数据
+        return chooseProductList(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
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '28%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商城售价', dataIndex: 'shopProductPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
+      ]
+      if (_this.form.promoType === 'BUY_PROD_GIVE_PROD') {
+        arr.splice(4, 0, { title: '买', dataIndex: 'conditionValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.splice(5, 0, { title: '赠', dataIndex: 'resultValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } })
+      } else if (_this.form.promoType === 'PROMO_PROD') {
+        arr.splice(5, 0, { title: '特价价格', dataIndex: 'conditionValue', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      } else {
+        arr.splice(5, 0, { title: '返券金额', dataIndex: 'resultValue', width: '10%', align: 'center', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    // 重置
+    resetSearchForm () {
+      this.form = {
+        promoType: undefined, // 促销类型
+        promoName: '', // '促销名称'
+        time: [], // 促销时间
+        promoStartDate: undefined, // 促销时间-开始
+        promoEndDate: undefined, // 促销时间-结束
+        sort: undefined, // 排序
+        allDealerFlag: '1', // 全部经销商 1   部分经销商0'
+        imageUrl: undefined, // 促销封面图
+        description: '', // '促销描述'
+        dealerEditFlag: '0', // 加盟商编辑 0否 1是
+        dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
+        rangeList: [], // 选择产品列表
+        discountType: 'STRAIGHT_DOWN', // 特价产品 - 优惠方式'
+        validName: '', // 券名称
+        validTitle: '', // 券副标题
+        validBaseType: undefined, // 券生成方式
+        validType: undefined, // 券有效期类型
+        validStartDate: undefined, // 券生效时间
+        validEndDate: undefined, // 券失效时间
+        validDays: undefined, // 券有效期天数
+        validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
+        validInfo: '' // 使用说明
+      }
+    },
+    // 获取列表详情
+    getDetail () {
+      shopPromoDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          this.form = res.data
+          this.$nextTick(() => {
+            this.$refs.table.refresh(true)
+          })
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      } else {
+        this.getDetail()
+      }
+    }
+  }
+}
+</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>

+ 770 - 0
src/views/easyPassManagement/promotionalActivities/edit.vue

@@ -0,0 +1,770 @@
+<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="$route.params.sn" 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="12" :sm="12" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="促销名称" prop="promoName" :label-col="{span:4}" :wrapper-col="{span:16}">
+                <a-input
+                  id="promotionEdit-promoName"
+                  :maxLength="20"
+                  v-model.trim="form.promoName"
+                  placeholder="请输入促销名称(最多20个字符)"
+                  allowClear/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
+              <a-form-model-item label="促销时间" prop="time" :label-col="{span:4}" :wrapper-col="{span:16}">
+                <a-range-picker
+                  style="width:100%"
+                  id="promotionAdd-time"
+                  v-model="form.time"
+                  :format="dateFormat"
+                  :disabled-date="disabledDate"
+                  @change="dateChange"
+                  :placeholder="['开始时间', '结束时间']" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="12" :sm="12" :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"
+                  allowClear
+                  placeholder="请输入排序数字(数字越大越靠后)"
+                  v-model="form.sort"
+                  :min="0"
+                  :max="99999999"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="参与经销商" prop="allDealerFlag">
+                <a-row :gutter="15">
+                  <a-col :md="10" :sm="24">
+                    <a-select
+                      style="width:98%;"
+                      id="promotionList-allDealerFlag"
+                      v-model="form.allDealerFlag"
+                      placeholder="请选择参与经销商"
+                      @change="changeDealerScope"
+                      :disabled="true"
+                      allowClear>
+                      <a-select-option id="promotionList-dealerScope-all" value="1">全部经销商</a-select-option>
+                      <a-select-option id="promotionList-dealerScope-some" value="0">部分经销商</a-select-option>
+                    </a-select>
+                  </a-col>
+                  <a-col :md="3" :sm="24" v-show="form.dealerScope && form.dealerScope!='ALL_DEALER' ">
+                    <a-button id="promotionList-basicInfo-dealerScope" type="primary" :loading="spinning" @click="handleDealerModal">选择</a-button>
+                  </a-col>
+                  <a-col :md="5" :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" id="promotionList-dealerSn" :key="con.dealerSn" @close="delBuyerName(con)">
+                        {{ con.dealerName }}
+                      </a-tag>
+                    </div>
+                  </a-col>
+                </a-row>
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="封面图片" prop="imageUrl" class="promotionEdit-img">
+                <Upload
+                  class="upload"
+                  id="promotionEdit-imageUrl"
+                  v-model="form.imageUrl"
+                  ref="imageSet"
+                  :fileSize="10"
+                  :maxNums="1"
+                  @change="changeImage"
+                  listType="picture-card"></Upload>
+                <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="description">
+                <a-input
+                  v-model="form.description"
+                  type="textarea"
+                  id="promotionEdit-description"
+                  placeholder="请输入促销描述(最多500个字符)"
+                  :maxLength="500" />
+              </a-form-model-item>
+            </a-col>
+            <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+              <a-form-model-item label="加盟商开关权限" prop="dealerOpenFlag">
+                <v-select
+                  v-model="form.dealerOpenFlag"
+                  id="promotion-dealerOpenFlag"
+                  code="FLAG"
+                  showType="radio"
+                  :disabled="true"
+                  allowClear></v-select>
+              </a-form-model-item>
+            </a-col>
+            <!-- 买产品送代金券 -->
+            <div v-if="pageType=='BUY_PROD_GIVE_VALID'">
+              <a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
+                <a-form-model-item label="券名称" :label-col="{span:4}" :wrapper-col="{span:16}" prop="validName">
+                  <a-input
+                    id="promotionEdit-validName"
+                    :maxLength="20"
+                    v-model.trim="form.validName"
+                    placeholder="请输入券名称(最多20个字符)"
+                    allowClear />
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="12" :sm="12" :md="12" :lg="12" :xl="12">
+                <a-form-model-item label="券副标题" :label-col="{span:4}" :wrapper-col="{span:16}">
+                  <a-input
+                    id="promotionEdit-validTitle"
+                    :maxLength="20"
+                    v-model.trim="form.validTitle"
+                    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="validBaseType">
+                  <v-select
+                    style="width:40%;"
+                    v-model="form.validBaseType"
+                    id="promotionEdit-ruleBaseType"
+                    code="SHOP_PROMO_VALID_BASE_TYPE"
+                    placeholder="请选择生成方式"
+                    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="validType">
+                  <v-select
+                    style="width:40%;"
+                    v-model="form.validType"
+                    placeholder="请选择券有效期"
+                    id="promotionEdit-validType"
+                    code="SHOP_PROMO_VALID_TYPE"
+                    @change="handleValidType"
+                    allowClear></v-select>
+                  <a-range-picker
+                    v-show="form.validType==='FIXED'"
+                    style="width:40%;margin-left:10px;"
+                    v-model="timeLimit"
+                    :format="dateFormat"
+                    id="promotionEdit-time"
+                    @change="dateLimitChange"
+                    :disabled-date="disabledDate"
+                    :placeholder="['开始时间', '结束时间']" />
+                  <span style="width:40%;margin-left:10px;" v-show="form.validType==='LIMIT'">
+                    有效期<a-input-number
+                      style="margin:0 5px;"
+                      v-model="form.validDays"
+                      :step="1"
+                      id="promotionEdit-validDays"
+                      :max="99999999"
+                      :min="1"
+                      :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="validScope">
+                  全部产品
+                </a-form-model-item>
+              </a-col>
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <a-form-model-item label="使用说明" prop="validInfo">
+                  <a-input
+                    v-model="form.validInfo"
+                    type="textarea"
+                    id="promotionEdit-validInfo"
+                    placeholder="请输入使用说明(最多50个字符)"
+                    :maxLength="50" />
+                </a-form-model-item>
+              </a-col>
+            </div>
+            <div v-if="isShowNextStep">
+              <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
+                <a-form-model-item prop="productNum" :label="pageType==='BUY_PROD_GIVE_PROD'?'满赠规则': pageType==='PROMO_PROD'?'优惠方式':'返券产品'">
+                  <div class="productInfo flex-center">
+                    <!-- 买产品送产品 -->
+                    <div v-if="pageType==='BUY_PROD_GIVE_PROD'">
+                      同款产品买<a-input-number
+                        v-model="conditionValue"
+                        style="margin:0 5px;"
+                        :min="1"
+                        :step="1"
+                        :precision="0"
+                        :max="99999999"
+                        id="promotionEdit-conditionValue"
+                        size="small"/>赠
+                      <a-input-number
+                        v-model="resultValue"
+                        style="margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="0"
+                        :max="99999999"
+                        id="promotionEdit-resultValue"
+                        size="small"/>个(数量叠加)
+                      <a-button
+                        type="primary"
+                        id="promotionEdit-addSet-btn"
+                        class="button-primary"
+                        size="small"
+                        @click="handleBatchAdd">批量设置</a-button>
+                    </div>
+                    <!-- 特价产品 -->
+                    <div v-if="pageType==='PROMO_PROD'" style="width:80%;">
+                      <v-select
+                        v-model="form.discountType"
+                        ref="promoState"
+                        id="promotionList-discountType"
+                        code="SHOP_PROMO_DISCOUNT_TYPE"
+                        size="small"
+                        style="width:15%;margin-right:5px;"
+                        @change="handleDiscountType"
+                        placeholder="请选择"
+                        allowClear></v-select>
+                      <span v-show="form.discountType">{{ form.discountType==='STRAIGHT_DOWN'? '直降':'折扣' }}</span>
+                      <a-input-number
+                        v-model="resultValue"
+                        v-show="form.discountType"
+                        style="width:15%;margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="2"
+                        :max="99999999"
+                        id="promotionEdit-resultValue"
+                        size="small"/><span v-show="form.discountType">{{ form.discountType==='STRAIGHT_DOWN'? '元':'%' }}</span>
+                      <a-button
+                        type="primary"
+                        id="promotionEdit-addSet-btn"
+                        class="button-primary"
+                        size="small"
+                        @click="handleBatchAdd">批量设置</a-button>
+                    </div>
+                    <!-- 买产品返代金券 -->
+                    <div v-if="pageType=='BUY_PROD_GIVE_VALID'">
+                      返券金额
+                      <a-input-number
+                        v-model="resultValue"
+                        style="margin:0 5px;"
+                        :min="0"
+                        :step="1"
+                        :precision="2"
+                        :max="99999999"
+                        id="promotionEdit-resultValue"
+                        size="small"/>元
+                      <a-button
+                        type="primary"
+                        id="promotionEdit-addSet-btn"
+                        class="button-primary"
+                        size="small"
+                        @click="handleBatchAdd">批量设置</a-button>
+                    </div>
+                    <a-button type="primary" id="promotionEdit-add-btn" @click="handleChooseProduct" 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="form.promoSn" :discountType="form.discountType" :activeType="pageType"></productTable>
+                </div>
+              </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="isShowNextStep"
+        style="padding: 0 60px;">保存</a-button>
+      <a-button
+        type="primary"
+        class="button-primary"
+        style="padding: 0 30px;"
+        size="large"
+        v-if="!isShowNextStep"
+        @click="handleSave('part')">保存后设置产品</a-button>
+    </div>
+    <!-- 添加产品 -->
+    <chooseProduct
+      ref="chooseProduct"
+      :openModal="showProModal"
+      @ok="addProductSuccess"
+      @close="closeProductModal"></chooseProduct>
+    <!-- 选择经销商 -->
+    <chooseDealer :openModal="openDealerModal" @close="closeDealerModal" @ok="addDealerOk"></chooseDealer>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+// 组件
+import { VSelect, Upload } from '@/components'
+import Editor from '@/components/WEeditor'
+import chooseDealer from '@/views/easyPassManagement/homepageCarouselImg/chooseDealer'
+import productTable from './productTable'
+import chooseProduct from './chooseProductsModal.vue'
+// 接口
+import { saveChooseProduct, saveShopPromo, shopPromoDetail } from '@/api/shopPromo'
+export default {
+  name: 'ProductBrandEditModal',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, Editor, productTable, chooseDealer, chooseProduct },
+  data () {
+    return {
+      spinning: false,
+      // 表单 label 设置
+      formItemLayout: {
+        labelCol: { span: 2 },
+        wrapperCol: { span: 20 }
+      },
+      productRangeList: [], // 产品范围列表
+      dateFormat: 'YYYY-MM-DD', // 促销时间显示格式
+      openDealerModal: false, // 打开选择经销商弹窗
+      pageType: undefined, // 促销类型
+      // 链接配置内容
+      form: {
+        promoType: undefined, // 促销类型
+        promoName: '', // '促销名称'
+        time: [], // 促销时间
+        promoStartDate: undefined, // 促销时间-开始
+        promoEndDate: undefined, // 促销时间-结束
+        sort: undefined, // 排序
+        allDealerFlag: '1', // 全部经销商 1   部分经销商0'
+        imageUrl: undefined, // 促销封面图
+        description: '', // '促销描述'
+        dealerEditFlag: '0', // 加盟商编辑 0否 1是
+        dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
+        rangeList: [], // 选择产品列表
+        discountType: '', // 特价产品 - 优惠方式'
+        validName: '', // 券名称
+        validTitle: '', // 券副标题
+        validBaseType: 'category', // 券生成方式
+        validType: undefined, // 券有效期类型
+        validStartDate: undefined, // 券生效时间
+        validEndDate: undefined, // 券失效时间
+        validDays: undefined, // 券有效期天数
+        validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
+        validInfo: '', // 使用说明
+        productNum: 0
+      },
+      conditionValue: undefined, // 买产品送产品 买
+      resultValue: undefined, // 买产品送产品  赠  返券金额
+      chooseDealerList: [], // 所选经销商数据
+      timeLimit: [], // 有效期
+      promotionName: '', // 促销名称
+      showProModal: false, // 打开产品弹窗
+      isShowNextStep: false, // 是否显示下一步 并提交一半配置产品
+      // 表单验证规则
+      rules: {
+        promoName: [{ required: true, message: '请输入促销名称', trigger: 'blur' }],
+        time: [{ required: true, message: '请选择促销时间', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        allDealerFlag: [{ required: true, message: '请选择参与经销商', trigger: 'change' }],
+        imageUrl: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        description: [{ required: true, message: '请输入促销描述内容', trigger: 'blur' }],
+        dealerOpenFlag: [{ required: true, message: '请选择加盟商开关权限', trigger: 'change' }],
+        rangeList: [{ required: true, message: '请选择促销产品', trigger: 'change' }],
+        validName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
+        validBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
+        validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
+        validScope: [{ required: true, message: '请选择券适用范围', trigger: 'blur' }],
+        productNum: [{ required: true, message: '选择产品不能为空', trigger: 'blur' }]
+      }
+    }
+  },
+  methods: {
+    // 参与经销商  change
+    changeDealerScope () {},
+    // 部分 打开选择经销商弹窗
+    handleDealerModal () {
+      this.openDealerModal = true
+    },
+    // 添加参与经销商成功
+    addDealerOk () {},
+    // 关闭经销商弹窗
+    closeDealerModal () {
+      this.openDealerModal = false
+    },
+    // 禁用日期时间
+    disabledDate (current) {
+      return current && current < moment().startOf('day')
+    },
+    // 促销时间  change
+    dateChange (date, dateStrings) {
+      if (dateStrings && dateStrings[0]) {
+        this.form.time = dateStrings
+        this.form.promoStartDate = date.length ? dateStrings[0] + ' 00:00:00' : ''
+        this.form.promoEndDate = date.length ? dateStrings[1] + ' 23:59:59' : ''
+      } else {
+        this.form.time = []
+      }
+    },
+    // 有效期
+    dateLimitChange (date, dateStrings) {
+      if (dateStrings && dateStrings[0]) {
+        this.timeLimit = dateStrings
+        this.form.validStartDate = date.length ? dateStrings[0] + ' 00:00:00' : ''
+        this.form.validEndDate = date.length ? dateStrings[1] + ' 23:59:59' : ''
+      } else {
+        this.timeLimit = []
+      }
+    },
+    // 选择优惠方式 change
+    async handleDiscountType (val) {
+      this.form.discountType = val
+      this.resultValue = undefined
+      // const res = await clearByPromoSn({ promoSn: this.$route.params.sn })
+      // if (res.status == '200') {
+      //   this.$refs.chooseProductList.pageInit()
+      // }
+    },
+    // 添加产品
+    handleChooseProduct () {
+      this.showProModal = true
+      // this.$nextTick(() => {
+      //   this.$refs.chooseProduct.resetSearchForm()
+      // })
+    },
+    // 添加产品成功
+    addProductSuccess (list) {
+      const productArr = list.map(item => {
+        return {
+          promoSn: this.form.promoSn,
+          shopProductSn: item.shopProductSn,
+          productSn: item.productSn,
+          productCode: item.productCode,
+          conditionValue: item.conditionValue ? item.conditionValue : item.shopProductPrice
+        }
+      })
+      saveChooseProduct(productArr).then(res => {
+        if (res.status == 200) {
+          if (!res.data) {
+            this.showProModal = false
+            // 获取产品列表 有分页
+            this.$refs.chooseProductList.pageInit()
+          } else {
+            const _this = this
+            this.$confirm({
+              title: '提示',
+              content: res.data,
+              centered: true,
+              okText: '知道了',
+              cancelText: '取消', // 将cancelText设置为空字符串或去掉该属性可以隐藏取消按钮
+              cancelButtonProps: {
+                style: {
+                  display: 'none' // 通过设置样式隐藏取消按钮
+                }
+              },
+              onOk () {
+                _this.showProModal = false
+                // 获取产品列表 有分页
+                _this.$refs.chooseProductList.pageInit()
+              }
+            })
+          }
+        }
+      })
+    },
+    // 关闭产品弹窗
+    closeProductModal () {
+      this.showProModal = false
+    },
+    // 返回列表
+    handleBack () {
+      this.$router.push({ name: 'promotionalActivities', query: { closeLastOldTab: true } })
+    },
+    //  详情
+    async getDetail (ajaxData) {
+      const _this = this
+      const res = await shopPromoDetail(ajaxData)
+      if (res.status == 200) {
+        if (res.data.promoStartDate && res.data.promoEndDate) {
+          const startTime = res.data.promoStartDate.split(' ')[0]
+          const endTime = res.data.promoEndDate.split(' ')[0]
+          res.data.time = [startTime, endTime]
+        }
+        if (res.data.imageUrl) {
+          _this.$refs.imageSet.setFileList(res.data.imageUrl)
+        }
+        _this.form = res.data
+        _this.form.productNum = 0
+        _this.isShowNextStep = true
+        if (_this.$route.params.pageType === 'edit') {
+          _this.pageType = res.data.promoType
+          _this.promotionName = res.data.promoName
+        }
+
+        _this.$nextTick(() => {
+          _this.$refs.chooseProductList.pageInit()
+          _this.form.productNum = _this.$refs.chooseProductList.getChooseProductNum()
+        })
+      }
+    },
+    // 券有效期 change
+    handleValidType (con) {
+      this.form.validType = con
+      if (con === 'FIXED') {
+        this.form.validDays = undefined
+      } else {
+        this.timeLimit = []
+        this.form.validStartDate = undefined
+        this.form.validEndDate = undefined
+      }
+    },
+    //  确定保存  验证必填
+    handleSave (type) {
+      const _this = this
+      // 验证组件必填项
+      console.log('_this.form.productNum ', _this.form.productNum)
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.savePartInfo(type)
+        }
+      })
+    },
+    // 保存
+    savePartInfo (type) {
+      const _this = this
+      _this.form.promoType = _this.pageType
+      var formData = JSON.parse(JSON.stringify(_this.form))
+      if (formData.promoType === 'BUY_PROD_GIVE_VALID') {
+        if (formData.validType === 'FIXED') {
+          if (!formData.validStartDate || !formData.validEndDate) {
+            _this.$message.warning('请输入券有效期!')
+            return false
+          }
+        } else {
+          if (!formData.validDays) {
+            _this.$message.warning('请输入券有效期!')
+            return false
+          }
+        }
+      }
+      if (type === 'all') {
+        formData.productNum = _this.$refs.chooseProductList.getChooseProductNum()
+        if (formData.productNum && formData.productNum == 0) {
+          _this.$message.warning('请先选择产品!')
+          return
+        }
+        delete formData.productNum
+      }
+      delete formData.time
+      _this.spinning = true
+      saveShopPromo(formData).then(res => {
+        if (res.status == 200) {
+          _this.spinning = false
+          if (res.data.errorMsg && res.data.errorMsg.length > 0) {
+            this.$confirm({
+              title: '提示',
+              content: res.data.errorMsg.map((item, i) => { return <p>{i * 1 + 1}、{item}</p> }),
+              centered: true,
+              okText: '知道了',
+              cancelText: '取消', // 将cancelText设置为空字符串或去掉该属性可以隐藏取消按钮
+              cancelButtonProps: {
+                style: {
+                  display: 'none' // 通过设置样式隐藏取消按钮
+                }
+              },
+              onOk () {
+                console.log('知道了')
+              }
+            })
+            return
+          }
+          _this.$message.success(res.message)
+          if (type === 'all') {
+            _this.$nextTick(() => {
+              _this.handleBack()
+              _this.resetSearchForm()
+            })
+          } else {
+            _this.isShowNextStep = true
+            _this.getDetail({ sn: res.data.shopPromo.promoSn })
+          }
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    //  封面图片上传
+    changeImage (file) {
+      this.form.imageUrl = file
+    },
+    // 重置
+    resetSearchForm () {
+      this.form = {
+        promoType: undefined, // 促销类型
+        promoName: '', // '促销名称'
+        time: [], // 促销时间
+        promoStartDate: undefined, // 促销时间-开始
+        promoEndDate: undefined, // 促销时间-结束
+        sort: undefined, // 排序
+        allDealerFlag: '1', // 全部经销商 1   部分经销商0'
+        imageUrl: undefined, // 促销封面图
+        description: '', // '促销描述'
+        dealerEditFlag: '0', // 加盟商编辑 0否 1是
+        dealerOpenFlag: '0', // 加盟商开关权限 0否 1是
+        rangeList: [], // 选择产品列表
+        discountType: '', // 特价产品 - 优惠方式'
+        validName: '', // 券名称
+        validTitle: '', // 券副标题
+        validBaseType: 'category', // 券生成方式
+        validType: undefined, // 券有效期类型
+        validStartDate: undefined, // 券生效时间
+        validEndDate: undefined, // 券失效时间
+        validDays: undefined, // 券有效期天数
+        validScope: '1', // 券适用范围标记 1-全部 0-指定  死值 1
+        validInfo: '', // 使用说明
+        productNum: 0
+      }
+      this.$refs.imageSet.setFileList('')
+      this.isShowNextStep = false
+      if (this.$refs.ruleForm) {
+        this.$refs.ruleForm.resetFields()
+      }
+    },
+    // 批量设置
+    handleBatchAdd () {
+      if (!this.conditionValue && !this.resultValue) {
+        this.$message.warning('请输入促销优惠规则!')
+        return
+      }
+      this.$refs.chooseProductList.editMorePrice({ conditionValue: this.conditionValue, resultValue: this.resultValue })
+    },
+    // 初始化
+    pageInit () {
+      this.form.discountType = ''
+      if (this.$route.params.pageType === 'edit') {
+        this.getDetail({ sn: this.$route.params.sn })
+      } else {
+        this.pageType = this.$route.params.pageType
+      }
+    }
+  },
+  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;
+    .buyerBox{
+      border:1px solid #d9d9d9;
+      margin-top:10px;
+      border-radius:4px;
+      padding:4px 10px;
+      background:#f2f2f2;
+      max-height:130px;
+      overflow-y:scroll;
+      scrollbar-width: none;
+    }
+    >.ant-spin-nested-loading{
+      overflow-y: scroll;
+      height: 100%;
+    }
+    /deep/.ant-form-item{
+      margin-bottom:8px;
+    }
+     // .ant-form-item-control
+    .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>

+ 423 - 0
src/views/easyPassManagement/promotionalActivities/list.vue

@@ -0,0 +1,423 @@
+<template>
+  <div>
+    <a-card size="small" :bordered="false" class="promotion-wrap searchBoxNormal">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="table-page-search-wrapper">
+        <a-form layout="inline" id="promotion-form" @keyup.enter.native="$refs.table.refresh(true)">
+          <a-row :gutter="15">
+            <a-col :md="5" :sm="24">
+              <a-form-item label="创建时间">
+                <rangeDate id="promotion-createDate" ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="促销名称">
+                <a-input id="promotion-promoName" v-model.trim="queryParam.promoName" allowClear placeholder="请输入促销名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="促销类型">
+                <v-select
+                  v-model="queryParam.promoType"
+                  ref="promotionType"
+                  id="promotion-promoType"
+                  code="SHOP_PROMO_PROMO_TYPE"
+                  placeholder="请选择促销类型"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="5" :sm="24">
+              <a-form-item label="促销状态">
+                <v-select
+                  v-model="queryParam.promoState"
+                  ref="promoState"
+                  id="promotion-promoState"
+                  code="SHOP_PROMO_PROMO_STATE"
+                  placeholder="请选择促销状态"
+                  allowClear></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="4" :sm="24">
+              <div class="table-page-search-submitButtons">
+                <a-button type="primary" :disabled="disabled" id="promotion-refresh" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" :disabled="disabled" id="promotion-reset" @click="resetSearchForm()">重置</a-button>
+              </div>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-card>
+    <!-- 列表 -->
+    <a-card size="small" :bordered="false">
+      <a-spin :spinning="spinning" tip="Loading...">
+        <!-- 操作按钮 -->
+        <div class="table-operator" v-if="$hasPermissions('B_promoActivitiesAdd')">
+          <!-- <a-button type="primary" class="button-info" id="promotion-add1-btn" @click="handleEdit('BUY_PROD_GIVE_PROD')">买产品送产品</a-button> -->
+          <a-button type="primary" class="button-info" id="promotion-add2-btn" @click="handleEdit('PROMO_PROD')">特价产品</a-button>
+          <a-button type="primary" class="button-info" id="promotion-add3-btn" @click="handleEdit('BUY_PROD_GIVE_VALID')">买产品返代金券</a-button>
+        </div>
+        <s-table
+          class="sTable fixPagination"
+          ref="table"
+          :style="{ height: tableHeight+70+'px' }"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :scroll="{ y: tableHeight }"
+          :defaultLoadData="false"
+          bordered>
+          <!-- 促销名称 -->
+          <template slot="promotionName" slot-scope="text, record">
+            <div :id="'promotion-info-'+record.id" v-if="$hasPermissions('B_promoActivitiesDetail')" class="link-bule nameBox text-overflows2" @click="handleDetail(record)">{{ record.promoName }}</div>
+            <div v-else class="nameBox text-overflows2">{{ record.promoName }}</div>
+          </template>
+          <!-- 促销时间 -->
+          <template slot="promotionTime" slot-scope="text, record">
+            <span>{{ record.promoStartDate }}至{{ record.promoEndDate }}</span>
+          </template>
+          <!-- 参与经销商 -->
+          <template slot="joinCustomers" slot-scope="text, record">
+            <span @click="handleCustomers(record)" :id="'promotion-seeDealerInfo-'+record.id" v-if="record.allDealerFlag&&record.allDealerFlag!='1'">共有<span class="link-bule">{{ record.dealerSnList.length }}</span>个客户</span>
+            <span v-else>全部经销商</span>
+          </template>
+          <!-- 促销类型 -->
+          <template slot="salesDesc" slot-scope="text, record">
+            <a-tooltip placement="rightBottom" v-if="record.description&&record.description.length>14">
+              <template slot="title">
+                <span>{{ record.description }}</span>
+              </template>
+              <div @click="promotionDesc(record)" :id="'promotion-description-'+record.id" class="link-bule">{{ record.description }}</div>
+            </a-tooltip>
+            <div v-else-if="!record.description" class="desc">--</div>
+            <div v-else @click="promotionDesc(record)" :id="'promotion-description1-'+record.id" class="link-bule">{{ record.description }}</div>
+          </template>
+          <!-- 操作 -->
+          <!-- promoState状态 END已结束    HAVE_DISCARD已废弃    HAVE_RELEASE  已发布    NOT_RELEASE  未发布 -->
+          <template slot="action" slot-scope="text, record">
+            <div>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                :id="'promotion-edit-btn-'+record.id"
+                @click="handleEdit('edit',record)"
+                v-if="(record.promoState=='NOT_RELEASE') && $hasPermissions('B_promoActivitiesEdit')">编辑</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                :id="'promotion-abandon-btn-'+record.id"
+                v-if="(record.promoState=='HAVE_RELEASE') && $hasPermissions('B_promoActivitiesAbandon')"
+                @click="handleAbandon(record)">废弃</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-warning"
+                :id="'promotion-img-btn-'+record.id"
+                v-if="(record.promoState=='HAVE_RELEASE') && $hasPermissions('B_promoActivitiesImg')"
+                @click="handleSet(record)">轮播图</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleRelease(record)"
+                v-if="record.promoState=='NOT_RELEASE'&&$hasPermissions('B_promoActivitiesRelease')"
+                :id="'promotion-release-btn-'+record.id">发布</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-error"
+                v-if="record.promoState=='NOT_RELEASE'&&$hasPermissions('B_promoActivitiesDel')"
+                @click="handleDel(record)"
+                :id="'promotion-del-btn-'+record.id">删除</a-button>
+            </div>
+          </template>
+        </s-table>
+      </a-spin>
+      <!-- 参与经销商 -->
+      <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
+      <!-- 详情 -->
+      <detail-Modal :openModal="openDetailModal" :itemSn="itemId" @close="closeDetailModal" @ok="$refs.table.refresh()" />
+      <!-- 轮播图修改弹窗 -->
+      <a-modal
+        closable
+        v-model="openSetImgModal"
+        :footer="null"
+        width="416px"
+        centered>
+        <div style="display:flex;margin:30px 0 20px 20px;">
+          <a-icon type="question-circle" :style="{fontSize:'20px',color:'#faad14'}"/>
+          <div style="margin-left:10px;margin-top:-3px;">
+            <p style="font-size:16px;font-wight:bold;">设置</p>
+            <p>确定设为首页轮播图吗?</p>
+          </div>
+        </div>
+        <!-- 按钮 -->
+        <div style="text-align: right;">
+          <a-button
+            id="auditModal-cancel"
+            type="primary"
+            @click="handleSetModal('0')"
+            style="margin-right: 15px;">取消</a-button>
+          <a-button
+            type="primary"
+            id="auditModal-save"
+            class="button-info"
+            @click="handleSetModal('1')"
+          >确定</a-button>
+        </div>
+      </a-modal>
+    </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 detailModal from './detailModal'
+// 接口
+import { shopPromoActiveList, shopPromoDel, shopPromoRelease, shopPromoDiscard, updateShopBanner } from '@/api/shopPromo'
+
+export default {
+  name: 'PromotionalActivitiesList',
+  mixins: [commonMixin],
+  components: { STable, VSelect, rangeDate, lookUpCustomersModal, detailModal },
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      openCustomerModal: false, // 打开参与经销商弹窗
+      openDetailModal: false, // 打开详情弹窗
+      createDate: [], //  创建时间
+      openSetImgModal: false, // 设置首页轮播图弹窗
+      // 查询参数
+      queryParam: {
+        beginDate: undefined, // 促销开始时间
+        endDate: undefined, // 促销结束时间
+        promoName: '', // 促销名称
+        promoType: undefined, // 促销类型
+        promoState: undefined// 是否发布
+      },
+      itemId: '', // 当前活动sn
+      itemObj: null, // 促销活动当前行信息
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return shopPromoActiveList(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
+        })
+      },
+      // 表头
+      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: '促销名称', scopedSlots: { customRender: 'promotionName' }, width: '18%', align: 'left' },
+        { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '18%', align: 'center' },
+        { title: '参与经销商', scopedSlots: { customRender: 'joinCustomers' }, width: '8%', align: 'center' },
+        { title: '促销类型', dataIndex: 'promoTypeDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '加盟商编辑', dataIndex: 'dealerEditFlag', width: '6%', align: 'center', customRender: function (text) { return (text ? text == '1' ? '是' : '否' : '--') } },
+        { title: '首页轮播图', dataIndex: 'shopBannerFlag', width: '6%', align: 'center', customRender: function (text) { return (text ? text == '1' ? '是' : '否' : '--') } },
+        { title: '促销状态', dataIndex: 'promoStateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '11%', align: 'center' }
+      ]
+    }
+  },
+  methods: {
+    //  创建时间  change
+    dateCreateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    // 参与经销商
+    handleCustomers (row) {
+      this.openCustomerModal = true
+      this.$nextTick(() => {
+        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.dealerSnList ? row.dealerSnList : undefined, promoActiveSn: row.promoActiveSn })
+      })
+    },
+    // 新增  编辑
+    handleEdit (type, row) {
+      if (type === 'edit') {
+        this.$router.push({ name: 'promotionalEditActivity', params: { pageType: type, sn: row.promoSn } })
+      } else {
+        this.$router.push({ name: 'promotionalAddActivity', params: { pageType: type } })
+      }
+    },
+    // 删除促销活动
+    handleDel (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '点击确定,该内容将会被删除,不可再恢复!',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          shopPromoDel({ promoSn: row.promoSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 废弃
+    handleAbandon (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要废弃该促销活动吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          shopPromoDiscard({ promoSn: row.promoSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 重置
+    resetSearchForm () {
+      this.createDate = []
+      this.$refs.rangeCreateDate.resetDate([])
+      this.queryParam.beginDate = undefined
+      this.queryParam.endDate = undefined
+      this.queryParam.promoName = ''
+      this.queryParam.promoType = undefined
+      this.queryParam.promoState = undefined
+      this.$refs.table.refresh(true)
+    },
+    // 促销发布
+    handleRelease (row, type) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要发布该促销活动吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          shopPromoRelease({ promoSn: row.promoSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 打开 设置轮播图弹窗
+    handleSet (row) {
+      this.itemObj = row
+      this.openSetImgModal = true
+    },
+    // 设置轮播图
+    handleSetModal (val) {
+      const _this = this
+      _this.spinning = true
+      updateShopBanner({ promoSn: _this.itemObj.promoSn, shopBannerFlag: val }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.openSetImgModal = false
+          _this.itemObj = null
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    // 打开详情
+    handleDetail (row) {
+      this.openDetailModal = true
+      this.itemId = row.promoSn
+    },
+    // 关闭详情
+    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
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less" scoped>
+  .font1{
+   color:#39f;
+  }
+  .desc{
+    width: 100%;
+    padding:0 10px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    display: -webkit-box;
+    box-sizing: border-box;
+    -webkit-line-clamp: 3;
+    -webkit-box-orient: vertical;
+  }
+</style>

+ 236 - 0
src/views/easyPassManagement/promotionalActivities/lookUpCustomersModal.vue

@@ -0,0 +1,236 @@
+<template>
+  <a-modal
+    centered
+    class="lookUpCustomers-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="参与经销商"
+    v-model="isShow"
+    @cancel="isShow = false"
+    width="60%">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <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-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                  <AreaList id="lookUpCustomers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="区域/分区">
+                  <subarea ref="subarea" id="lookUpCustomers-subarea" @change="subareaChange"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="经销商名称">
+                  <a-input id="lookUpCustomers-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"
+                  style="margin-left: 10px"
+                  id="lookUpCustomers-export"
+                  class="button-warning"
+                  @click="handleExport"
+                  :disabled="disabled"
+                  :loading="exportLoading">导出</a-button>
+              </a-col>
+            </a-row>
+          </a-form>
+        </div>
+        <!-- 列表 -->
+        <s-table
+          class="sTable"
+          ref="table"
+          size="small"
+          :rowKey="(record) => record.id"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          :scroll="{ y: 450 }"
+          :rowClassName="(record, index) => record.checkProfitLossQty < 0 ? 'redBg-row':''"
+          bordered>
+          <!-- 地区 -->
+          <template slot="address" slot-scope="text, record">
+            <span v-if="record.dealerEntity&&record.dealerEntity.provinceName">{{ record.dealerEntity.provinceName }}/{{ record.dealerEntity.cityName }}/{{ record.dealerEntity.districtName }}</span>
+            <span v-else>--</span>
+          </template>
+        </s-table>
+      </a-card>
+      <div class="btn-cont">
+        <a-button id="lookUpCustomers-modal-close" @click="isShow = false">关闭</a-button>
+      </div>
+    </a-spin>
+  </a-modal>
+</template>
+
+<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 { dealerExport } from '@/api/promoTerminal'
+import { shopBannerSeeDealer, shopBannerExport } from '@/api/shopBanner'
+export default {
+  name: 'LookUpCustomersModal',
+  components: { STable, ProductType, subarea, AreaList },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, // 是否打开弹框
+      disabled: false, // 查询、重置按钮是否可操作
+      advanced: false, // 高级搜索 展开/关闭
+      exportShow: false, // 导出弹窗显示
+      exportLoading: false, // 导出按钮加载状态
+      // 查询条件
+      queryParam: {
+        // 区域分区
+        subareaArea: {
+          subareaSn: undefined, // 区域
+          subareaAreaSn: undefined// 分区
+        },
+        provinceSn: undefined, // 省sn
+        citySn: undefined, // 市sn
+        districtSn: undefined, // 区sn
+        dealerName: undefined// 经销商名称
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        return shopBannerSeeDealer(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
+        })
+      },
+      snObj: undefined, // 经销商列表
+      columns: [// 表头
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '地区', scopedSlots: { customRender: 'address' }, width: '20%', align: 'center', ellipsis: true },
+        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '经销商名称', dataIndex: 'dealerName', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerEntity.dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ]
+    }
+  },
+  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,
+        citySn: undefined,
+        districtSn: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        }
+      }, this.snObj)
+      this.queryParam.dealerName = undefined
+      this.$refs.areaList.clearData()
+      this.$refs.subarea.clearData()
+      this.$refs.table.refresh(true)
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(shopBannerExport, _this.queryParam, '首页轮播图参与经销商列表导出', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.showExport = true
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      }
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .lookUpCustomers-modal{
+    .ant-modal-body{
+      padding: 0 24px 24px;
+    }
+    .redBg-row{
+      background-color: #f5cdc8;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 5px 0 10px;
+    }
+    .table-page-search-wrapper{
+      margin-bottom:6px;
+      /deep/.ant-select-selection{
+        border:0 !important;
+        box-shadow: none !important;
+      }
+      .ant-form.ant-form-inline .ant-form-item{
+        border:1px solid #dadada;
+        border-radius: 3px;
+        overflow: hidden;
+        margin-bottom: 10px!important;
+        /deep/.ant-form-item-label{
+          padding-left: 11px !important;
+          padding-right: 0!important;
+        }
+      }
+    }
+  }
+</style>

+ 243 - 0
src/views/easyPassManagement/promotionalActivities/productTable.vue

@@ -0,0 +1,243 @@
+<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="conditionValue" slot-scope="text,record">
+          <a-input-number
+            :min="1"
+            :step="1"
+            :precision="0"
+            :max="99999999"
+            @blur="editProductVal(record,'conditionValue')"
+            placeholder="请输入"
+            v-model="record.conditionValue"
+            :id="'productTable-conditionValue'+record.id "
+            size="small"/>
+        </template>
+        <!-- 赠 -->
+        <template slot="resultValue" slot-scope="text,record">
+          <a-input-number
+            :min="1"
+            :step="1"
+            :precision="0"
+            :max="99999999"
+            style="width:90%;"
+            @blur="editProductVal(record,'resultValue')"
+            placeholder="请输入"
+            v-model="record.resultValue"
+            :id="'productTable-resultValue'+record.id "
+            size="small"/>
+        </template>
+        <!-- 买产品送代金券 返券金额 -->
+        <template slot="priceValue" slot-scope="text,record">
+          <a-input-number
+            :min="0.01"
+            :step="1"
+            :precision="2"
+            :max="99999999"
+            style="width:90%;"
+            @blur="editProductVal(record,'resultValue')"
+            placeholder="请输入"
+            v-model="record.resultValue"
+            :id="'productTable-resultValue'+record.id "
+            size="small"/>
+        </template>
+        <!-- 特价价格-->
+        <template slot="specialOffer" slot-scope="text,record">
+          <a-input-number
+            :step="1"
+            :precision="2"
+            :max="99999999"
+            style="width:90%;"
+            @blur="editProductVal(record,'conditionValue')"
+            placeholder="请输入"
+            v-model="record.conditionValue"
+            :id="'productTable-conditionValue'+record.id "
+            size="small"/>
+          <!-- 直降 -->
+          <!-- <span v-if="discountType==='STRAIGHT_DOWN'">{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice-record.resultValue).toFixed(2):'--' }}</span> -->
+          <!-- 折扣 -->
+          <!-- <span v-else>{{ (record.resultValue&&record.shopProductPrice)?(record.shopProductPrice*record.resultValue/100).toFixed(2):'--' }}</span> -->
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text,record">
+          <a-button
+            size="small"
+            type="link"
+            class="button-error"
+            :id="'productTable-del-btn'+record.id "
+            @click="handleDel(record)"
+          >删除</a-button>
+        </template>
+      </s-table>
+    </a-spin>
+  </div>
+</template>
+<script>
+import { commonMixin } from '@/utils/mixin'
+// 组件
+import { STable } from '@/components'
+// 接口
+import { chooseProductList, delChooseProduct, modifyChooseProduct } from '@/api/shopPromo'
+export default {
+  name: 'ProductTable',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    promoActiveSn: {// 活动sn
+      type: String,
+      default: ''
+    },
+    activeType: {// 促销活动类型
+      type: String,
+      default: ''
+    },
+    discountType: {// 特价产品时,优惠方式
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      rowSelectionInfo: null, // 已选数据
+      queryParam: {}, // 查询条件
+      chooseProductNum: 0, // 列表数据个数
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        params.promoSn = this.promoActiveSn
+        return chooseProductList(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 (this.activeType === 'PROMO_PROD') {
+                data.list[i].conditionValue = data.list[i].conditionValue ? data.list[i].conditionValue : data.list[i].shopProductPrice
+              }
+            }
+            this.chooseProductNum = data.count
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '25%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productOrigCode', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商城售价', dataIndex: 'shopProductPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
+      ]
+      if (_this.activeType === 'BUY_PROD_GIVE_PROD') {
+        arr.splice(4, 0, { title: '买', scopedSlots: { customRender: 'conditionValue' }, width: '10%', align: 'center' })
+        arr.splice(5, 0, { title: '赠', scopedSlots: { customRender: 'resultValue' }, width: '10%', align: 'center' })
+      } else if (_this.activeType === 'PROMO_PROD') {
+        arr.splice(5, 0, { title: '特价价格', width: '10%', align: 'right', scopedSlots: { customRender: 'specialOffer' } })
+      } else {
+        arr.splice(5, 0, { title: '返券金额', scopedSlots: { customRender: 'priceValue' }, width: '10%', align: 'center' })
+      }
+      return arr
+    },
+    // 计算列表选中数据条数
+    selectCount () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length
+    }
+  },
+  methods: {
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 批量已选产品信息
+    editProductVal (row, typeName) {
+      let ajaxData = []
+      row.resultValue = this.activeType === 'PROMO_PROD' ? undefined : row.resultValue
+      if (typeName != 'all') {
+        ajaxData.push({
+          id: row.id,
+          promoSn: this.promoActiveSn,
+          productPrice: typeName === 'productPrice' ? row.productPrice : undefined,
+          conditionValue: typeName === 'conditionValue' ? row.conditionValue : undefined,
+          resultValue: typeName === 'resultValue' ? row.resultValue : undefined
+        })
+        if (this.activeType === 'PROMO_PROD' && this.discountType === 'DISCOUNT') {
+          ajaxData[0].resultValue = row.resultValue ? row.resultValue / 100 : ''
+        }
+      } else {
+        ajaxData = row || []
+      }
+      modifyChooseProduct(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.$refs.table.refresh(true)
+          this.$refs.table.clearSelected() // 清空表格选中项
+        }
+      })
+    },
+    // 修改产品活动价、返券金额
+    editMorePrice (oldObjInfo) {
+      if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length === 0)) {
+        this.$message.warning('请选择要修改的产品!')
+        return
+      }
+      let ajaxArr = []
+      const objInfo = JSON.parse(JSON.stringify(oldObjInfo))
+      if (this.activeType === 'PROMO_PROD') {
+        if (this.discountType === 'STRAIGHT_DOWN') {
+          ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, productPrice: item.shopProductPrice, conditionValue: (item.shopProductPrice - objInfo.resultValue), resultValue: objInfo.resultValue } })
+        } else {
+          ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: (item.shopProductPrice * (objInfo.resultValue / 100)), resultValue: objInfo.resultValue / 100 } })
+        }
+      } else {
+        ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue } })
+      }
+      this.editProductVal(ajaxArr, 'all')
+    },
+    // 删除
+    handleDel (row) {
+      const _this = this
+      _this.spinning = true
+      delChooseProduct([{ id: row.id, promoSn: _this.promoActiveSn }]).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
+    getChooseProductNum () {
+      return this.chooseProductNum
+    },
+    // 初始化
+    pageInit () {
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

+ 1 - 6
src/views/promotionRulesManagement/promotionManagement/edit.vue

@@ -306,12 +306,7 @@
                   <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-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" id="promotionEdit-dealerEditFlag" :disabled="isDisabled" v-model="form.promoRule.dealerEditFlag">
                     <a-radio-button value="1">

+ 1 - 1
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -308,7 +308,7 @@ export default {
             <span style="padding-right: 15px;">{data}</span>
             {ftext ? (<a-badge count={ftext} number-style={{ backgroundColor: fcolor, zoom: '80%' }}></a-badge>) : ''}
             {record.bakConvertPromoGiftsQty ? (<a-badge count="转" number-style={{ backgroundColor: '#ffaa00', zoom: '80%' }}></a-badge>) : ''}
-            {Number(record.stockQty || 0) < Number(record.unpushedQty || 0) ? (<a-badge count="缺" number-style={{ zoom: '80%' }}></a-badge>) : ''}
+            { Number((_this.showLockStockQty ? record.lockStockQty : record.stockQty) || 0) < Number(record.unpushedQty || 0) ? (<a-badge count="缺" number-style={{ zoom: '80%' }}></a-badge>) : ''}
           </div>
         )
       }