chenrui 9 ヶ月 前
コミット
660b04c5e4

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

@@ -0,0 +1,314 @@
+<template>
+  <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" v-if="pageType=='dealerPromotion'">
+            <a-form-model-item label="地区">
+              <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="经销商名称/别名">
+              <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" v-if="pageType!='viewDealers'">
+            <a-form-item label="所在区域/分区">
+              <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
+            </a-form-item>
+          </a-col>
+          <div v-else>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="审核状态">
+                <v-select code="AUDIT_STATE" id="chooseDealer-auditState" v-model="queryParam.auditState" allowClear placeholder="请选择审核状态"></v-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-model-item label="地区">
+                <AreaList id="chooseDealer-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+              </a-form-model-item>
+            </a-col>
+          </div>
+          <a-col :md="pageType!='viewDealers'?8:6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="searchForm(true)" :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>
+</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: {
+    pageType: {// 页面类型
+      type: String,
+      default: ''
+    },
+    parentData: {// 父级数据
+      type: Object,
+      default: function () {
+        return null
+      }
+    },
+    itemSn: {// 当前活动sn
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      dealerType: [], // 商户类型
+      //  查询条件
+      queryParam: {
+        nameLike: '', // 经销商名称/别名
+        dealerType1: undefined, //  商户类型
+        dealerType2: undefined, //  商户类型
+        dealerLevel: null, // 商户级别
+        subareaArea: {
+          subareaSn: undefined, //  区域
+          subareaAreaSn: undefined // 分区
+        },
+        auditState: undefined, // 审核状态
+        provinceSn: undefined, // 省份sn
+        citySn: undefined, // 市sn
+        districtSn: undefined// 区sn
+      },
+      // 分页
+      pagination: {
+        pageSize: 20,
+        showSizeChanger: true,
+        pageSizeOptions: ['20', '50', '100', '200', '500']
+      },
+      pageFlag: false,
+      chooseInfo: [], // 已选经销商列表
+      selectedRowKeys: [], // 已选活动数据
+      dealerList: [], // 经销商列表数据
+      tableHeight: 0, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false // 批量添加loading
+    }
+  },
+  computed: {
+    // 计算选择活动条数
+    selectCount () {
+      return this.selectedRowKeys && this.selectedRowKeys.length
+    },
+    // 表头
+    columns () {
+      const arr = [
+        { title: '经销商名称', dataIndex: 'dealerName', width: '25%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { 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 || '--' } }
+      ]
+      if (this.pageType === 'dealerPromotion') {
+        arr.unshift({ title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '30%', align: 'center', ellipsis: true })
+      }
+      return arr
+    }
+  },
+  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 }
+      this.queryParam.notDealerSn = this.itemSn ? this.itemSn : undefined
+      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()
+      this.spinning = false
+    },
+    // 区域分区
+    subareaChange (val) {
+      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
+    },
+    // 获取商户类型
+    getDealerType (v, o) {
+      this.queryParam.dealerType1 = v[0]
+      this.queryParam.dealerType2 = v[1]
+    },
+    //  重置
+    resetSearchForm () {
+      this.dealerType = []
+      this.queryParam = {
+        nameLike: '',
+        dealerType1: undefined, //  商户类型
+        dealerType2: undefined, //  商户类型
+        dealerLevel: null,
+        subareaArea: {
+          subareaSn: undefined, //  区域
+          subareaAreaSn: undefined // 分区
+        },
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined
+      }
+      if (this.pageType != 'viewDealers') {
+        this.$refs.subarea.clearData()
+        if (this.pageType == 'dealerPromotion') {
+          this.$refs.areaList.clearData()
+        }
+      } else {
+        this.$refs.areaList.clearData()
+      }
+
+      this.pagination.pageNo = 1
+      this.pagination.current = 1
+      this.loadData()
+      this.pageFlag = false
+    },
+    // 批量添加
+    async handleBatchAudit () {
+      const _this = this
+      if (_this.selectedRowKeys && _this.selectedRowKeys.length < 1) {
+        _this.$message.warning('请在列表勾选后再进行批量操作!')
+        return
+      }
+      const dealerInfoList = await getDealerListInfo({ dealerSnList: _this.selectedRowKeys })
+      this.spinning = false
+      this.$emit('plAdd', dealerInfoList.data)
+    },
+    // 确定
+    handleAdd (row) {
+      if (row.subareaArea) {
+        const _this = this
+        this.$confirm({
+          title: '提示',
+          content: '当前经销商已被其他区域分区绑定,确定要更新绑定关系吗?',
+          centered: true,
+          onOk () {
+            _this.spinning = true
+            _this.$emit('add', row)
+          }
+        })
+      } else {
+        this.spinning = true
+        this.$emit('add', row)
+      }
+    },
+    // 初始化
+    pageInit (data) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+      this.selectedRowKeys = []
+      this.chooseInfo = data || []
+      this.resetSearchForm()
+    },
+    // 计算表格高度
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 285
+    }
+  },
+  watch: {
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  }
+}
+</script>

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

@@ -0,0 +1,338 @@
+<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="title">
+            {{ form.title }}
+          </a-form-model-item>
+          <a-form-model-item label="轮播时间" prop="validType" >
+            <span>
+             {{ form.promoRule.validStartDate }}~{{ form.promoRule.validEndDate }}
+            </span>
+          </a-form-model-item>
+          <a-form-model-item label="轮播图排序" prop="sort">
+            {{ form.sort }}
+          </a-form-model-item>
+          <a-form-model-item label="参与经销商" prop="sort">
+           <span>{{ form.sort }}</span>
+            <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-form-model-item>
+          <a-form-model-item label="封面图片" prop="imageSet">
+            <img
+              :src="con"
+              alt="图片走丢了"
+              width="80"
+              height="80"
+              v-for="(con,i) in imageSet"
+              style="margin-right:10px;object-fit: cover;"
+              :key="i"/>
+            <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
+          </a-form-model-item>
+          <a-form-model-item label="内容类型" prop="contentType">
+            {{ form.contentType==='IMAGE_CONTENT'?'图文展示':form.contentType==='VIDEO'?'视频展示':'跳转链接' }}
+          </a-form-model-item>
+          <a-form-model-item label="内容" prop="content" >
+            <div class="box" v-html="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 { productTypeQuery } from '@/api/productType'
+import { promoActiveDetail, promoRuleProductList } from '@/api/promoActive'
+
+export default {
+  name: 'DetailModal',
+  mixins: [commonMixin],
+  components: { STable },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {// 活动sn
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      // form表单label布局
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      productTypeList: [], // 产品范围数据
+      productRangeList: [], // 已选产品范围
+      chooseDealerList:[{},{}],
+      form: {
+        promoActiveSn: undefined, // 促销活动sn
+        title: '', // 标题
+        imageSet: '', // 图片
+        contentType: 'IMAGE_CONTENT', // 内容类型
+        content: '', // 内容
+        contentLink: '', // 链接内容
+        sort: undefined, // 排序
+        ruleEnableFlag: '1', // 参数配置 1勾选配置  0不能配置
+        publishFlag: '0', // 是否发布 0 否 1是
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        promoRule: {
+          ruleType: 'ticket', // 基本规则类型
+          productRangeFlag: '', // 产品范围标记 0无  1有产品范围
+          productRangeList: [], // 产品范围列表
+          ruleName: '', // 券名称
+          ruleTitle: '', // 副标题
+          ruleBaseType: 'category', // 券生成方式
+          ruleExplain: '', // 使用说明
+          validType: undefined, // 券有效期类型
+          validStartDate: undefined, // 券生效时间
+          validEndDate: undefined, // 券失效时间
+          validDays: undefined, // 券有效期天数
+          range: '1'
+        }
+      },
+      imageSet: [], // 封面图
+      columns: [// 表头
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'origCode', width: '20%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动价', dataIndex: 'price', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
+        { title: '返券金额', dataIndex: 'ruleValue', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } },
+        { title: '参考终端价', dataIndex: 'terminalPrice', width: '10%', align: 'right', customRender: text => { return ((text || text == 0) ? this.toThousands(text) : '--') } }
+      ],
+      // 表单验证规则
+      rules: {
+        title: [{ required: true, message: '请输入标题名称', trigger: 'blur' }],
+        imageSet: [{ required: true, message: '请选择要上传的封面图片', trigger: 'change' }],
+        sort: [{ required: true, message: '请输入排序数字', trigger: 'blur' }],
+        contentType: [{ required: true, message: '请选择内容类型', trigger: 'change' }],
+        content: [{ required: true, message: '请输入对应内容', trigger: ['blur', 'change'] }],
+        contentLink: [{ required: true, message: '请输入对应内容', trigger: 'blur' }],
+        publishFlag: [{ required: true, message: '请选择是否发布', trigger: 'change' }],
+        range: [{ required: true, message: '请选择券适用范围', trigger: 'change' }],
+        ruleType: [{ required: true, message: '请选择基本规则', trigger: 'change' }],
+        ruleName: [{ required: true, message: '请输入券名称', trigger: ['change', 'blur'] }],
+        ruleBaseType: [{ required: true, message: '请选择生成方式', trigger: 'change' }],
+        validType: [{ required: true, message: '请选择券有效期类型', trigger: 'change' }],
+        ruleDetailList: [{ type: 'array', required: true, message: '请选择券内容', trigger: 'blur' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const params = Object.assign(parameter, this.queryParam)
+        params.promoActiveSn = this.itemSn
+        // 获取详情  已选参与活动产品数据
+        return promoRuleProductList(params).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            // 计算表格序号
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  methods: {
+    // 重置
+    resetSearchForm () {
+      this.form = {
+        promoActiveSn: undefined, // 促销活动sn
+        title: '', // 标题
+        imageSet: '', // 图片
+        contentType: 'IMAGE_CONTENT', // 内容类型
+        content: '', // 内容
+        contentLink: '', // 链接内容
+        sort: undefined, // 排序
+        ruleEnableFlag: '1', // 参数配置 1勾选配置  0不能配置
+        publishFlag: '0',
+        dealerEditFlag: '0', // 加盟商编辑 1是 0否
+        promoRule: {
+          ruleType: 'ticket', // 基本规则类型
+          productRangeFlag: '', // 产品范围标记 0无  1有产品范围
+          productRangeList: [], // 产品范围列表
+          ruleName: '', // 券名称
+          ruleTitle: '', // 副标题
+          ruleBaseType: 'category', // 券生成方式
+          ruleExplain: '', // 使用说明
+          validType: undefined, // 券有效期类型
+          validStartDate: undefined, // 券生效时间
+          validEndDate: undefined, // 券失效时间
+          validDays: undefined, // 券有效期天数
+          range: '1'
+        }
+      }
+      this.imageSet = []
+    },
+    // 获取列表详情
+    getDetail () {
+      promoActiveDetail({ sn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          if (res.data.contentType === 'LINK') {
+            console.log('加载产品范围')
+            this.$nextTick(() => {
+              this.getTreeData()
+            })
+            if (res.data.promoRule && res.data.promoRule.productRangeList && res.data.promoRule.productRangeList.length > 0) {
+              this.productRangeList = res.data.promoRule.productRangeList.map(item => { return item.productTypeSn })
+            } else {
+              this.productRangeList = []
+            }
+          }
+          if (res.data.imageSet) {
+            this.form.imageSet = res.data.imageSet.join(',')
+            this.imageSet = res.data.imageSet
+          }
+          this.form = res.data
+        }
+      })
+    },
+    // 获取产品范围数据
+    getTreeData () {
+      productTypeQuery({}).then(res => {
+        if (res.status == 200) {
+          this.productTypeList = res.data
+        } else {
+          this.productTypeList = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      } else {
+        this.getDetail()
+        this.$nextTick(() => {
+          this.$refs.table.refresh(true)
+        })
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotion-basicInfo-modal{
+    .detailModal-con{
+      max-height: 600px;
+      overflow-y: scroll;
+    }
+    .timeBox{
+      color:#ed1c24;
+      opacity: .7;
+    }
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .promotion-basicInfo-con{
+      margin-top:10px;
+    }
+    .ant-form-item{
+      margin-bottom:0 !important;
+    }
+    .buyerBox{
+      border:1px solid #d9d9d9;
+      margin: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>

+ 5 - 3
src/views/easyPassManagement/homepageCarouselImg/edit.vue

@@ -115,12 +115,12 @@
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
               <a-form-model-item label="内容" prop="content" v-show="form.contentType =='IMAGE_CONTENT'">
                 <editor
-                  v-show="pageType === 'add'||(pageType === 'edit'&&!isDisabled)"
                   id="promotionEdit-editor"
                   ref="editor"
                   class="promotionEdit-editor"
                   @on-change="editorChange"
                   :cache="false"></editor>
+                <!-- v-show="pageType === 'add'||(pageType === 'edit'&&!isDisabled)" -->
                 <div v-if="(pageType === 'edit')&&isDisabled" class="box" v-html="form.content"></div>
               </a-form-model-item>
               <a-form-model-item label="上传视频" prop="content" v-show="form.contentType =='VIDEO'">
@@ -193,13 +193,13 @@
         style="padding: 0 60px;">保存</a-button>
     </div>
     <!-- 添加产品 -->
-    <chooseProduct
+    <!-- <chooseProduct
       ref="chooseProduct"
       :chooseType="chooseTypeList"
       :itemSn="$route.params.sn"
       :openModal="showProModal"
       @ok="addProductSuccess"
-      @close="closeProductModal"></chooseProduct>
+      @close="closeProductModal"></chooseProduct> -->
   </div>
 </template>
 
@@ -299,6 +299,8 @@ export default {
         this.form.promoRule.validEndDate = dateString[1] + ' 23:59:59'
       }
     },
+    handleDealerModal () {},
+    changeDealerScope () {},
     // 打开产品弹窗
     insterProduct (obj) {
       if (obj && Object.keys(obj).length > 0) {

+ 103 - 101
src/views/easyPassManagement/homepageCarouselImg/list.vue

@@ -1,18 +1,18 @@
 <template>
   <div>
-    <a-card size="small" :bordered="false" class="promotion-wrap searchBoxNormal">
+    <a-card size="small" :bordered="false" class="carouselImage-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-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="promotion-createDate" ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
+                <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="promotion-promotionName" v-model.trim="queryParam.name" allowClear placeholder="请输入轮播图名称"/>
+                <a-input id="carouselImage-promotionName" v-model.trim="queryParam.name" allowClear placeholder="请输入轮播图名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -20,7 +20,7 @@
                 <v-select
                   v-model="queryParam.publishState"
                   ref="publishState"
-                  id="promotion-publishState"
+                  id="carouselImage-publishState"
                   code="PROMO_STATE"
                   placeholder="请选择轮播图状态"
                   allowClear></v-select>
@@ -28,8 +28,8 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <span 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>
+                <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>
@@ -41,7 +41,7 @@
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator" v-if="$hasPermissions('B_promotionManagementAdd')">
-          <a-button type="primary" id="promotion-add-btn" @click="openAddModal = true">新增</a-button>
+          <a-button type="primary" id="carouselImage-add-btn" @click="handleAddOrEdit()">新增</a-button>
         </div>
         <s-table
           class="sTable fixPagination"
@@ -64,7 +64,7 @@
           </template>
           <!-- 参与客户 -->
           <template slot="joinCustomers" slot-scope="text, record">
-            <span @click="handleCustomers(record)" :id="'promotion-seeDealerInfo-'+record.id" v-if="record.dealerSnList&&record.dealerSnList.length>0">共有<span class="link-bule">{{ record.dealerSnList.length }}</span>个客户</span>
+            <span class="customerBox" @click="handleCustomers(record)" :id="'carouselImage-seeDealerInfo-'+record.id" v-if="record.dealerSnList&&record.dealerSnList.length>0">共有<span class="link-bule">{{ record.dealerSnList.length }}</span>个客户</span>
             <span v-else>共有0个客户</span>
           </template>
           <!-- 促销描述 -->
@@ -73,20 +73,17 @@
               <template slot="title">
                 <span>{{ record.description }}</span>
               </template>
-              <div @click="promotionDesc(record)" :id="'promotion-description-'+record.id" class="link-bule">{{ record.description }}</div>
+              <div @click="promotionDesc(record)" :id="'carouselImage-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-description-'+record.id" class="link-bule">{{ record.description }}</div>
+            <div v-else-if="!record.description">--</div>
+            <div v-else @click="promotionDesc(record)" :id="'carouselImage-description-'+record.id" class="link-bule">{{ record.description }}</div>
           </template>
           <!-- 促销展示 -->
           <template slot="salesShow" slot-scope="text, record">
-            <div @click="handleSaleShow(record)" :id="'promotion-seeImgInfo-'+record.id" v-if="record.contentType!='LINK'&&record.imageSet && record.imageSet.length>0">
+            <div @click="handleCheckImg(record)" :id="'carouselImage-seeImgInfo-'+record.id">
               <img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
             </div>
-            <div v-else-if="record.contentType=='LINK'&&record.imageSet && record.imageSet.length>0">
-              <img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
-            </div>
-            <span v-else>--</span>
+            <!-- <span v-else>--</span> -->
           </template>
           <!-- 操作 -->
           <!-- state状态 END已结束    CLOSE已关闭    PUBLISH  已发布    UNPUBLISH  未发布 -->
@@ -96,49 +93,45 @@
                 size="small"
                 type="link"
                 class="button-warning"
-                :id="'promotion-edit-btn-'+record.id"
-                @click="promotionEdit(record)"
+                :id="'carouselImage-edit-btn-'+record.id"
+                @click="handleAddOrEdit(record)"
                 v-if="(record.publishState=='UNPUBLISH' || record.publishState=='CLOSE') && $hasPermissions('B_promotionManagementEdit')">编辑</a-button>
-              <a-button
-                size="small"
-                type="link"
-                class="button-warning"
-                :id="'promotion-modify-btn-'+record.id"
-                @click="handleRelease(record,'edit')"
-                v-if="((record.publishState=='PUBLISH'&&record.content!='/pagesB/promoDetail')||(record.publishState=='PUBLISH'&&record.content==='/pagesB/promoDetail'&&record.dealerEditFlag==='0') || record.publishState=='CLOSE')&&$hasPermissions('B_promotionManagementContent')">发布修改</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-success"
                 @click="handleSee(record)"
                 v-if="(record.publishState=='PUBLISH' || record.publishState=='END')&&$hasPermissions('B_promotionManagementDetail')"
-                :id="'promotion-seeDetail-btn-'+record.id">查看</a-button>
+                :id="'carouselImage-seeDetail-btn-'+record.id">查看</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-info"
-                @click="handleRelease(record,'add')"
+                @click="handleRelease(record)"
                 v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementContent')"
-                :id="'promotion-release-btn-'+record.id">发布</a-button>
+                :id="'carouselImage-release-btn-'+record.id">发布</a-button>
+              <a-button
+                size="small"
+                type="link"
+                class="button-info"
+                @click="handleClose(record)"
+                v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementContent')"
+                :id="'carouselImage-release-btn-'+record.id">关闭</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-error"
                 v-if="record.publishState=='UNPUBLISH'&&$hasPermissions('B_promotionManagementDel')"
                 @click="handleDel(record)"
-                :id="'promotion-del-btn-'+record.id">删除</a-button>
+                :id="'carouselImage-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>
-      <!-- 促销描述 -->
-      <promotion-desc-modal :openModal="openDescModal" :con="descCon" @close="openDescModal = false;descCon=''"></promotion-desc-modal>
-      <!-- 促销展示 -->
-      <promotion-show-modal ref="showModal" :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
-      <!-- 新增 -->
-      <addModal :openModal="openAddModal" :itemId="itemId" @close="closeAddModal" @ok="$refs.table.refresh()"></addModal>
+      <!-- 封面展示 -->
+      <imgShowModal v-drag ref="checkedImg" :openModal="openCheckedImgModal" @close="openCheckedImgModal=false"></imgShowModal>
       <!-- 查看 -->
       <detail-Modal :openModal="openDetailModal" :itemSn="itemId" @close="closeDetailModal" @ok="$refs.table.refresh()" />
     </a-card>
@@ -150,38 +143,32 @@ import { commonMixin } from '@/utils/mixin'
 // 组件
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-// import lookUpCustomersModal from './lookUpCustomersModal'
-// import promotionDescModal from './promotionDescModal'
-// import promotionShowModal from './promotionShowModal'
-// import addModal from './addModal'
-// import detailModal from './detailModal'
+import lookUpCustomersModal from '@/views/easyPassManagement/promotionalActivities/lookUpCustomersModal'
+import imgShowModal from '@/views/easyPassManagement/shoppingManagement/imgShowModal'
+import detailModal from './detailModal'
 // 接口
 import { promoActiveList, promoActiveDel } from '@/api/promoActive'
 export default {
   name: 'PromotionList',
   mixins: [commonMixin],
-  components: { STable, VSelect, rangeDate },
+  components: { STable, VSelect, rangeDate, lookUpCustomersModal, detailModal, imgShowModal },
   data () {
     return {
       spinning: false,
       tableHeight: 0, // 表格高度
       disabled: false, //  查询、重置按钮是否可操作
-      openCustomerModal: false, // 打开参与客户弹窗
-      openDescModal: false, // 打开促销描述弹窗
-      openShowModal: false, // 打开促销展示弹窗
-      openAddModal: false, // 打开新增弹窗
+      openCustomerModal: false, // 打开参与经销商弹窗
+      openCheckedImgModal: false, // 查看封面图弹窗
       openDetailModal: false, // 打开详情弹窗
-      createDate: [], //  创建时间
-      itemId: '', // 当前活动sn
-      descCon: '', // 描述内容
       pageType: '', // 发布类型  add  促销发布  edit 发布修改
-      dealerSn: [], // 经销商sn
+      itemId: '', // 当前活动sn
+      createDate: [], //  创建时间
       // 查询参数
       queryParam: {
-        beginDate: undefined, // 促销开始时间
-        endDate: undefined, // 促销结束时间
-        name: '', // 促销名称
-        publishState: undefined// 是否发布
+        beginDate: undefined, // 创建开始时间
+        endDate: undefined, // 创建结束时间
+        name: '', // 轮播图名称
+        publishState: undefined// 轮播图状态
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -205,9 +192,9 @@ export default {
       columns: [// 表头
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '轮播图名称', dataIndex: 'name', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '轮播时间', scopedSlots: { customRender: 'promotionTime' }, width: '12%', align: 'center' },
-        { title: '参与经销商', scopedSlots: { customRender: 'joinCustomers' }, width: '10%', align: 'center' },
+        { title: '轮播图名称', dataIndex: 'name', 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' },
         // { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: '6%', align: 'center' },
         { title: '轮播图状态', scopedSlots: { customRender: 'stateVal' }, width: '6%', align: 'center' },
@@ -216,44 +203,32 @@ export default {
     }
   },
   methods: {
-    // 关闭添加促销活动弹窗
-    closeAddModal () {
-      this.openAddModal = false; this.itemId = ''
-    },
-    // 参与经销商
-    handleCustomers (row) {
-      this.openCustomerModal = true
-      this.$nextTick(() => {
-        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.dealerSnList ? row.dealerSnList : undefined, promoActiveSn: row.promoActiveSn })
-      })
+    // 新增  编辑
+    handleAddOrEdit (row) {
+      // const newType = row ? 'edit' : 'add'
+      this.$router.push({ name: 'carouselImageAdd' })
     },
     //  创建时间  change
     dateCreateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
-    // 促销展示
-    handleSaleShow (record) {
-      this.openShowModal = true
-      this.$nextTick(() => {
-        this.$refs.showModal.pageInit({ type: record.contentType, con: record.content })
-      })
-    },
-    // 促销编辑
-    promotionEdit (item) {
-      this.itemId = item.promoActiveSn
+    // 参与经销商
+    handleCustomers (row) {
+      this.openCustomerModal = true
       this.$nextTick(() => {
-        this.openAddModal = true
+        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.dealerSnList ? row.dealerSnList : undefined, promoActiveSn: row.promoActiveSn })
       })
     },
-    // 促销描述
-    promotionDesc (row) {
-      this.descCon = row.description
-      this.$nextTick(() => {
-        this.openDescModal = true
+    // 封面图片
+    handleCheckImg (record) {
+      this.openCheckedImgModal = true
+      const _this = this
+      _this.$nextTick(() => {
+        _this.$refs.checkedImg.pageInit(record.imageSet[0])
       })
     },
-    // 删除促销活动
+    // 删除
     handleDel (row) {
       const _this = this
       this.$confirm({
@@ -274,6 +249,27 @@ export default {
         }
       })
     },
+    // 关闭
+    handleClose (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定关闭吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          promoActiveDel({ sn: row.promoActiveSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     // 重置
     resetSearchForm () {
       this.$refs.rangeCreateDate.resetDate(this.createDate)
@@ -283,10 +279,26 @@ export default {
       this.queryParam.publishState = undefined
       this.$refs.table.refresh(true)
     },
-    // 促销发布
-    handleRelease (row, type) {
-      const newType = row.imageSet && row.imageSet.length > 0 ? 'edit' : type
-      this.$router.push({ name: 'carouselImageAdd', params: { sn: row.promoActiveSn, pageType: newType } })
+    // 发布
+    handleRelease (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要发布吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          promoActiveDel({ sn: row.promoActiveSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
     },
     // 打开详情
     handleSee (row) {
@@ -340,17 +352,7 @@ export default {
 }
 </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;
+  .customerBox{
+    cursor:pointer;
   }
 </style>

+ 68 - 5
src/views/easyPassManagement/promotionalActivities/list.vue

@@ -116,20 +116,20 @@
                 type="link"
                 class="button-warning"
                 :id="'promotion-edit-btn-'+record.id"
-                @click="handleRelease(record)"
+                @click="handleEdit(record)"
                 v-if="(record.publishState=='UNPUBLISH' || record.publishState=='CLOSE') && $hasPermissions('B_promotionManagementEdit')">编辑</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-warning"
                 :id="'promotion-modify-btn-'+record.id"
-                @click="handleRelease(record,'edit')">废弃</a-button>
+                @click="handleAbandon(record,'edit')">废弃</a-button>
               <a-button
                 size="small"
                 type="link"
                 class="button-warning"
                 :id="'promotion-modify-btn-'+record.id"
-                @click="handleRelease(record,'edit')">轮播图</a-button>
+                @click="handleSet(record,'edit')">轮播图</a-button>
               <a-button
                 size="small"
                 type="link"
@@ -247,6 +247,11 @@ export default {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 编辑
+    handleEdit (row, type) {
+      const newType = row.imageSet && row.imageSet.length > 0 ? 'edit' : type
+      this.$router.push({ name: 'promotionalAddActivity', params: { sn: row.promoActiveSn, pageType: newType } })
+    },
     // 促销展示
     handleSaleShow (record) {
       this.openShowModal = true
@@ -289,6 +294,27 @@ export default {
         }
       })
     },
+    // 废弃
+    handleAbandon () {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要废弃该促销活动吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          promoActiveDel({ sn: row.promoActiveSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
     // 重置
     resetSearchForm () {
       this.$refs.rangeCreateDate.resetDate(this.createDate)
@@ -300,8 +326,45 @@ export default {
     },
     // 促销发布
     handleRelease (row, type) {
-      // const newType = row.imageSet && row.imageSet.length > 0 ? 'edit' : type
-      this.$router.push({ name: 'promotionalAddActivity', params: { sn: row.promoActiveSn, pageType: '' } })
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确认要发布该促销活动吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          promoActiveDel({ sn: row.promoActiveSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    // 设置轮播图
+    handleSet (row) {
+      const _this = this
+      this.$confirm({
+        title: '设置',
+        content: '确定设为首页轮播图吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          promoActiveDel({ sn: row.promoActiveSn }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
     },
     // 打开详情
     handleDetail (row) {