chenrui 2 lat temu
rodzic
commit
e24554cef8

+ 16 - 6
src/api/promoTerminal.js

@@ -36,19 +36,29 @@ export const promoTerminalDel = (params) => {
     method: 'get'
   })
 }
-//  优惠活动 详情  包含规则
-export const promoRuleDetailD = (params) => {
-  const url = `/promoRule/findDetailBySn/${params.sn}`
+//  促销活动 修改显示状态
+export const updateShowFlag = (params) => {
+  const url = `/promoTerminal/updateShowFlag/${params.sn}/${params.showFlag}`
   return axios({
     url: url,
     method: 'get'
   })
 }
-//  促销规则  获取可导入和不可导入列表数据
-export const promoRuleGoods = (params) => {
+//  促销活动发布
+export const saveActive = (params) => {
   return axios({
-    url: '/promoRule/parseGoods',
+    url: '/promoTerminal/saveActive',
     data: params,
     method: 'post'
   })
 }
+
+// 导出活动经销商列表
+export const dealerExport = (params) => {
+  return axios({
+    url: '/dealer/exportListForPromo',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 5 - 3
src/views/promotionRulesManagement/promotionManagement/addModal.vue

@@ -40,7 +40,7 @@
               </a-select>
             </a-col> -->
             <a-col :md="5" :sm="24">
-              <a-button type="primary" :loading="spinning" @click="handleDealer">选择经销商</a-button>
+              <a-button type="primary" :loading="spinning" @click="handleDealerModal">选择经销商</a-button>
             </a-col>
             <a-col :md="6" :sm="24" v-show="chooseDealerList && chooseDealerList.length>0">
               已{{ chooseDealerList.length }}选项
@@ -132,9 +132,12 @@ export default {
     }
   },
   methods: {
+    handleDealerModal () {
+      this.openDealerModal = true
+      this.handleDealer()
+    },
     handleDealer () {
       const _this = this
-      _this.openDealerModal = true
       const arr = _this.chooseDealerList.map(item => {
         return item.buyerSn
       })
@@ -161,7 +164,6 @@ export default {
     },
     // 获取编辑详情
     getEditInfo () {
-      const _this = this
       promoTerminalDetail({ sn: this.itemId }).then(res => {
         if (res.status == 200) {
           const data = res.data

+ 361 - 0
src/views/promotionRulesManagement/promotionManagement/editModal.vue

@@ -0,0 +1,361 @@
+<template>
+  <a-modal
+    centered
+    class="promotionEdit-modal"
+    :footer="null"
+    :maskClosable="false"
+    :title="modalTit"
+    v-model="isShow"
+    @cancel="isShow=false"
+    width="76%">
+    <!-- 表单 -->
+    <div>
+      <a-spin :spinning="spinning" tip="Loading..." class="promotionEdit-content">
+        <a-form-model
+          id="promotionEdit-form"
+          ref="ruleForm"
+          :model="form"
+          :rules="rules"
+          :label-col="formItemLayout.labelCol"
+          :wrapper-col="formItemLayout.wrapperCol"
+        >
+          <a-form-model-item label="标题名称" prop="title">
+            <a-input
+              id="promotionEdit-title"
+              :maxLength="100"
+              v-model.trim="form.title"
+              placeholder="请输入标题名称(最多100个字符)"
+              :disabled="pageType === 'edit'"
+              allowClear/>
+          </a-form-model-item>
+          <a-form-model-item label="封面图片" prop="imageSet">
+            <Upload
+              v-if="pageType==='add'"
+              class="upload"
+              id="promotionEdit-imageSet"
+              v-model="form.imageSet"
+              ref="imageSet"
+              :fileSize="10"
+              :maxNums="10"
+              @change="changeImage"
+              listType="picture-card"></Upload>
+            <div v-else>
+              <img
+                :src="con"
+                alt="图片走丢了"
+                width="80"
+                height="80"
+                v-for="(con,i) in images"
+                style="margin-right:10px;"
+                :key="i" />
+            </div>
+            <span class="upload-desc">说明:单张大小小于10Mb,最多10张;建议尺寸:宽(420px)*高(230px)</span>
+          </a-form-model-item>
+          <a-form-model-item label="排序" prop="sort">
+            <a-input
+              id="promotionEdit-sort"
+              type="number"
+              v-model.trim="form.sort"
+              placeholder="请输入排序数字(数字越大越靠后)"
+              :disabled="pageType === 'edit'"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="内容类型" prop="contentType">
+            <v-select
+              v-model="form.contentType"
+              ref="saleStatus"
+              id="promotion-saleStatus"
+              code="PROMO_CONTENT_TYPE"
+              showType="radio"
+              :disabled="pageType === 'edit'"
+              allowClear></v-select>
+          </a-form-model-item>
+          <a-form-model-item label="内容" prop="content" v-show="form.contentType =='IMAGE_CONTENT'">
+            <editor
+              v-show="pageType === 'add'"
+              id="promotionEdit-editor"
+              ref="editor"
+              class="promotionEdit-editor"
+              @on-change="editorChange"
+              :cache="false"></editor>
+            <div v-show="pageType === 'edit'" class="box" v-html="form.content"></div>
+          </a-form-model-item>
+          <a-form-model-item label="上传视频" prop="content" v-show="form.contentType =='VIDEO'">
+            <Upload
+              v-if="pageType==='add'"
+              class="upload"
+              id="promotionEdit-imageSet"
+              v-model="videoPath"
+              fileType="video/mp4"
+              ref="imageSet"
+              :fileSize="10"
+              :maxNums="1"
+              @change="changeVideo"
+              listType="picture-card"></Upload>
+            <div v-else>
+              <video width="100" height="100">
+                <source :src="videoPath" type="video/mp4"></source>
+              </video>
+            </div>
+            <span class="upload-desc">说明:文件最大1G;视频:mp4.avi.flv</span>
+          </a-form-model-item>
+          <a-form-model-item label="跳转链接" prop="content" v-show="form.contentType =='LINK'">
+            <a-input
+              :disabled="pageType === 'edit'"
+              id="promotionEdit-title"
+              :maxLength="100"
+              v-model.trim="form.content"
+              placeholder="请输入跳转链接"
+              allowClear />
+          </a-form-model-item>
+          <a-form-model-item label="是否发布" prop="enabledFlag">
+            <a-radio-group button-style="solid" v-model="form.enabledFlag">
+              <a-radio-button value="1">
+                是
+              </a-radio-button>
+              <a-radio-button value="0">
+                否
+              </a-radio-button>
+            </a-radio-group>
+          </a-form-model-item>
+          <a-form-model-item label="是否显示" prop="showFlag" v-show="form.enabledFlag == 1">
+            <a-radio-group button-style="solid" v-model="form.showFlag">
+              <a-radio-button value="1">
+                显示
+              </a-radio-button>
+              <a-radio-button value="0">
+                隐藏
+              </a-radio-button>
+            </a-radio-group>
+          </a-form-model-item>
+        </a-form-model>
+      </a-spin>
+      <div class="btn-cont">
+        <a-button id="product-brand-edit-modal-back" @click="isShow = false" >取消</a-button>
+        <a-button
+          style="margin:0 15px;color: #fff;background-color: #39f;border-color: #39f;"
+          @click="handleSee">预览</a-button>
+        <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">确定</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import moment from 'moment'
+import { VSelect, Upload } from '@/components'
+import Editor from '@/components/WEeditor'
+import { saveActive, promoTerminalDetail } from '@/api/promoTerminal'
+export default {
+  name: 'ProductBrandEditModal',
+  mixins: [commonMixin],
+  components: { VSelect, Upload, Editor },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemId: {
+      type: [Number, String],
+      default: ''
+    },
+    pageType: {
+      type: String,
+      default: 'add'
+    }
+  },
+  computed: {
+    modalTit () {
+      return this.pageType != 'add' ? '发布修改' : '促销发布'
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      spinning: false,
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        promoActiveSn: undefined,
+        title: '',
+        contentType: 'IMAGE_CONTENT',
+        imageSet: '',
+        showFlag: undefined,
+        content: '',
+        enabledFlag: '1',
+        sort: undefined
+      },
+      images: [],
+      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'] }
+        ],
+        enabledFlag: [
+          { required: true, message: '请选择是否发布', trigger: 'change' }
+        ],
+        showFlag: [
+          { required: true, message: '请选择是否显示', trigger: 'change' }
+        ]
+      }
+    }
+  },
+  methods: {
+    // 预览
+    handleSee () {
+
+    },
+    onChange (e) {
+      console.log('radio checked', e.target.value)
+    },
+    //  详情
+    getDetail () {
+      promoTerminalDetail({ sn: this.itemId }).then(res => {
+        if (res.status == 200) {
+          this.form.promoActiveSn = res.data.promoActiveSn
+          this.form.title = res.data.title
+          this.form.contentType = res.data.contentType
+          this.form.showFlag = res.data.showFlag
+          this.form.enabledFlag = res.data.enabledFlag
+          this.form.sort = res.data.sort
+          this.images = res.data.imageSet
+          this.form.imageSet = res.data.imageSet
+          this.form.content = res.data.content
+          if (res.data.contentType == 'IMAGE_CONTENT') {
+            this.$refs.editor.setHtml(res.data.content)
+          } else if (res.data.contentType == 'VIDEO') {
+            this.videoPath = res.data.content
+          }
+        }
+      })
+    },
+    //  确定
+    handleSave () {
+      const _this = this
+      _this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.form.promoActiveSn = this.itemId
+          const formData = JSON.parse(JSON.stringify(_this.form))
+          formData.imageSet = formData.imageSet ? formData.imageSet.split(',') : []
+          _this.spinning = true
+          saveActive(formData).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('ok')
+              _this.isShow = false
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    //  图片上传
+    changeImage (file) {
+      this.form.imageSet = file
+    },
+    // 视频上传
+    changeVideo (file) {
+      this.form.content = file
+    },
+    //  文本编辑器
+    editorChange (html, text) {
+      this.form.content = html
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.$refs.imageSet.setFileList('')
+        this.$refs.editor.setHtml('')
+        this.form = {
+          promoActiveSn: undefined,
+          title: '',
+          contentType: 'IMAGE_CONTENT',
+          imageSet: '',
+          showFlag: undefined,
+          content: '',
+          enabledFlag: '1',
+          sort: undefined
+        }
+        this.images = []
+        this.$refs.ruleForm.resetFields()
+      } else {
+        if (this.pageType === 'edit') {
+          this.getDetail()
+        }
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .promotionEdit-modal{
+    .promotionEdit-content{
+      max-height:60vh;
+      overflow-y: scroll;
+  }
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .upload{
+      width: 100%!important;
+    }
+    /deep/.upload-file .ant-upload-list-item-info{
+      padding:2px !important;
+    }
+    //  商品图片描述
+    .upload-desc{
+      font-size: 12px;
+      color: #808695;
+    }
+    //  文本编辑器  工具栏样式换行
+    .promotionEdit-editor{
+      .w-e-toolbar{
+        flex-wrap: wrap;
+      }
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+    #promotionEdit-attachList{
+      height: auto;
+    }
+    a{
+      color: inherit;
+    }
+    .box{
+      border:1px solid #d9d9d9;
+      border-radius:4px;
+      padding:4px 11px;
+      color:rgba(0, 0, 0, 0.25);
+      cursor: not-allowed;
+      background:#fdfdfd;
+    }
+  }
+</style>

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

@@ -32,7 +32,7 @@
                   v-model="queryParam.state"
                   ref="saleStatus"
                   id="promotion-saleStatus"
-                  code="SALES_RETURN_BILL_STATUS"
+                  code="PROMO_STATE"
                   placeholder="请选择促销状态"
                   allowClear></v-select>
               </a-form-item>
@@ -75,10 +75,10 @@
         <template slot="arrowFalg" slot-scope="text, record">
           <a-switch
             checkedChildren="显示"
-            unCheckedChildren="不显示"
+            unCheckedChildren="隐藏"
             id="promotion-isEnable"
             v-model="record.isEnable"
-            @change="changeFlagHandle(text, record)" />
+            @change="changeFlagHandle(record)" />
         </template>
         <!-- 促销时间 -->
         <template slot="promotionTime" slot-scope="text, record">
@@ -86,16 +86,16 @@
         </template>
         <!-- 参与客户 -->
         <template slot="joinCustomers" slot-scope="text, record">
-          <span @click="openCustomerModal=true">共有{{ record.promoBuyerSnSet?record.promoBuyerSnSet.length:0 }}个客户</span>
+          <span @click="handleCustomers(record)">共有<span class="font1">{{ record.promoBuyerSnSet?record.promoBuyerSnSet.length:0 }}</span>个客户</span>
         </template>
         <!-- 促销描述 -->
         <template slot="salesDesc" slot-scope="text, record">
-          <span @click="openDescModal=true">{{ record.description }}</span>
+          <span @click="promotionDesc(record)" class="font1">{{ record.description }}</span>
         </template>
         <!-- 促销展示 -->
         <template slot="salesShow" slot-scope="text, record">
-          <div v-if="record.src" @click="openShowModal=true">
-            <img :src="record.src" alt="图片走丢啦" width="100">
+          <div @click="handleSaleShow(record)" v-if="record.imageSet && record.imageSet.length>0">
+            <img :src="record.imageSet[0]" alt="图片走丢啦" width="60" />
           </div>
           <span v-else>--</span>
         </template>
@@ -106,8 +106,8 @@
               size="small"
               type="link"
               class="button-warning"
-              @click="handleEexamine(record)"
-              v-if="record.state=='PUBLISH'"
+              @click="handleRelease(record,'edit')"
+              v-if="record.state=='PUBLISH' || record.state=='CLOSE'"
               id="promotion-modify-btn">发布修改</a-button>
             <a-button
               size="small"
@@ -120,8 +120,8 @@
               size="small"
               type="link"
               class="button-info"
-              @click="handleEdit(record)"
-              v-if="record.state=='UNPUBLISH' || record.state=='CLOSE'"
+              @click="handleRelease(record,'add')"
+              v-if="record.state=='UNPUBLISH'"
               id="promotion-release-btn">促销发布</a-button>
             <a-button
               size="small"
@@ -136,13 +136,15 @@
       </s-table>
     </a-spin>
     <!-- 参与客户 -->
-    <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
+    <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false;"></lookUp-customers-modal>
     <!-- 促销描述 -->
-    <promotion-desc-modal :openModal="openDescModal" @close="openDescModal = false"></promotion-desc-modal>
+    <promotion-desc-modal :openModal="openDescModal" :con="descCon" @close="openDescModal = false;descCon=''"></promotion-desc-modal>
     <!-- 促销展示 -->
-    <promotion-show-modal :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
+    <promotion-show-modal :imgList="imgsList" :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
     <!-- 新增 -->
-    <addModal :openModal="openAddModal" :itemId="itemId" @close="openAddModal = false"></addModal>
+    <addModal :openModal="openAddModal" :itemId="itemId" @close="openAddModal = false;itemId = ''"></addModal>
+    <!-- 促销发布 -->
+    <promotion-edit-modal :pageType="pageType" :openModal="openPromotionEditModal" :itemId="itemId" @close="closePromotionEditModal" @ok="$refs.table.refresh()" />
   </a-card>
 </template>
 
@@ -150,11 +152,12 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import rangeDate from '@/views/common/rangeDate.vue'
-import { promoTerminalList, promoTerminalDel } from '@/api/promoTerminal'
+import { promoTerminalList, promoTerminalDel, updateShowFlag } from '@/api/promoTerminal'
 import lookUpCustomersModal from './lookUpCustomersModal'
 import promotionDescModal from './promotionDescModal'
 import promotionShowModal from './promotionShowModal'
 import addModal from './addModal'
+import promotionEditModal from './editModal'
 export default {
   name: 'PromotionList',
   mixins: [commonMixin],
@@ -165,7 +168,8 @@ export default {
     lookUpCustomersModal,
     promotionShowModal,
     promotionDescModal,
-    addModal
+    addModal,
+    promotionEditModal
   },
   data () {
     return {
@@ -176,8 +180,12 @@ export default {
       openDescModal: false,
       openShowModal: false,
       openAddModal: false,
+      openPromotionEditModal: false,
       createDate: [], //  创建时间
       itemId: '',
+      descCon: '', // 描述内容
+      pageType: '', // 发布类型  add  促销发布  edit 发布修改
+      dealerSn: [],
       // 查询参数
       queryParam: {
         beginDate: undefined,
@@ -186,6 +194,7 @@ export default {
         showFlag: undefined,
         state: undefined
       },
+      imgsList: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -212,28 +221,42 @@ export default {
         { title: '促销名称', dataIndex: 'name', width: '12%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '8%', align: 'center' },
         { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '12%', align: 'center' },
-        { title: '促销描述', scopedSlots: { customRender: 'salesDesc' }, width: '12%', align: 'center' },
+        { title: '促销描述', scopedSlots: { customRender: 'salesDesc' }, width: '12%', align: 'center', ellipsis: true },
         { title: '促销展示', scopedSlots: { customRender: 'salesShow' }, width: '6%', align: 'center' },
         { slots: { title: 'arrowFalgTitle' }, scopedSlots: { customRender: 'arrowFalg' }, width: '6%', align: 'center' },
-        { title: '促销状态', dataIndex: 'state', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '促销状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ]
     }
   },
   methods: {
+    // 参与经销商
+    handleCustomers (row) {
+      this.openCustomerModal = true
+      this.$nextTick(() => {
+        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.promoBuyerSnSet ? row.promoBuyerSnSet : undefined, promoActiveSn: row.promoActiveSn })
+      })
+    },
     //  创建时间  change
     dateCreateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
+    // 促销展示
+    handleSaleShow (record) {
+      this.imgsList = record.imageSet
+      this.$nextTick(() => {
+        this.openShowModal = true
+      })
+    },
     // 修改显示状态
-    changeFlagHandle (text, record) {
+    changeFlagHandle (record) {
       const _data = {
-        id: record.id,
-        flag: record.isEnable ? '1' : '0'
+        sn: record.promoActiveSn,
+        showFlag: record.isEnable ? '1' : '0'
       }
       this.spinning = true
-      updateEnableStatus(_data).then(res => {
+      updateShowFlag(_data).then(res => {
         if (res.status == 200) {
           this.$message.success(res.message)
           this.$refs.table.refresh()
@@ -251,6 +274,13 @@ export default {
         this.openAddModal = true
       })
     },
+    // 促销描述
+    promotionDesc (row) {
+      this.descCon = row.description
+      this.$nextTick(() => {
+        this.openDescModal = true
+      })
+    },
     // 删除促销活动
     handleDel (row) {
       const _this = this
@@ -281,6 +311,19 @@ export default {
       this.queryParam.state = undefined
       this.$refs.table.refresh(true)
     },
+    // 促销发布
+    handleRelease (row, type) {
+      this.itemId = row.promoActiveSn
+      this.pageType = type
+      this.$nextTick(() => {
+        this.openPromotionEditModal = true
+      })
+    },
+    // 关闭促销发布
+    closePromotionEditModal () {
+      this.openPromotionEditModal = false
+      this.itemId = ''
+    },
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -321,4 +364,7 @@ export default {
 }
 </script>
 <style lang="less">
+  .font1{
+   color:#39f;
+  }
 </style>

+ 30 - 145
src/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal.vue

@@ -73,7 +73,8 @@ import ProductType from '@/views/common/productType.js'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { checkWarehouseDetailList, checkWarehouseDetail, checkWarehouseDetailCount, checkWarehouseDetailExport, checkWarehouseDetailPrint, checkWarehouseWarehouse } from '@/api/checkWarehouse'
+import { dealerExport } from '@/api/promoTerminal'
+import { dealerQueryList } from '@/api/dealer'
 export default {
   name: 'LookUpCustomersModal',
   components: { STable, ProductType, subarea, AreaList },
@@ -82,10 +83,6 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
-    },
-    itemSn: {
-      type: String || Number,
-      default: ''
     }
   },
   data () {
@@ -95,44 +92,28 @@ export default {
       disabled: false,
       advanced: false,
       exportShow: false,
+      exportLoading: false,
       queryParam: {
-        productName: '',
-        productCode: '',
-        productTypeSn1: undefined,
-        productTypeSn2: undefined,
-        productTypeSn3: undefined,
-        warehouseSn: undefined,
-        subareaArea: {
-          subareaSn: undefined,
-          subareaAreaSn: undefined
-        },
-        exportLoading: false,
-        dealer: {
-          dealerSn: undefined,
-          provinceSn: undefined,
-          citySn: undefined,
-          districtSn: undefined,
-          dealerLevel: undefined
-        }
+        subareaSn: undefined,
+        subareaAreaSn: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        dealerSn: undefined
       },
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const params = Object.assign(parameter, this.queryParam, { checkWarehouseSn: this.itemSn })
-        if (this.isPrice) {
-          params.profitLossFlag = 1
-        }
-        return checkWarehouseDetailList(params).then(res => {
+        const params = Object.assign(parameter, this.queryParam)
+        return dealerQueryList(params).then(res => {
           let data
           if (res.status == 200) {
             data = res.data
-            this.getDetailCount(params)
             const no = (data.pageNo - 1) * data.pageSize
             for (var i = 0; i < data.list.length; i++) {
               data.list[i].no = no + i + 1
             }
-            this.localDataSource = data.list || []
             this.disabled = false
           }
           this.spinning = false
@@ -150,131 +131,52 @@ export default {
       printerType: 'NEEDLE', //  打印机类型
       columns: [
         { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
-        { title: '地区', dataIndex: 'productName', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
-        { title: '区域', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '经销商名称', dataIndex: 'productUnit', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户类型', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'productUnit', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '地区', dataIndex: 'address', width: '20%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '区域', dataIndex: 'subareaName', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '分区', dataIndex: '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: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
     }
   },
   methods: {
     areaChange (val) {
-      this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
-      this.queryParam.dealer.citySn = val[1] ? val[1] : ''
-      this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
+      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
+      this.queryParam.subareaSn = val[0] ? val[0] : undefined
+      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
     },
-    // 详情
-    getDetail () {
-      checkWarehouseDetail({ sn: this.itemSn }).then(res => {
-        if (res.status == 200) {
-          this.basicInfoData = res.data || null
-        } else {
-          this.basicInfoData = null
-        }
-      })
-    },
-    // 合计
-    getDetailCount (params) {
-      checkWarehouseDetailCount(params).then(res => {
-        if (res.status == 200) {
-          this.productTotal = res.data
-          if (res.data && res.data.checkLossQty) {
-            this.productTotal.checkLossQty = Math.abs(this.productTotal.checkLossQty || 0)
-          }
-        } else {
-          this.productTotal = null
-        }
-      })
+    pageInit (data) {
+      this.queryParam = Object.assign(this.queryParam, data)
+      this.$refs.table.refresh(true)
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.productName = ''
-      this.queryParam.productCode = ''
-      this.queryParam.warehouseSn = undefined
-      this.queryParam.productTypeSn1 = undefined
-      this.queryParam.productTypeSn2 = undefined
-      this.queryParam.productTypeSn3 = undefined
-      this.productType = []
-      this.queryParam.dealer = {
-        dealerSn: undefined,
+      this.queryParam = {
         provinceSn: undefined,
         citySn: undefined,
         districtSn: undefined,
-        dealerLevel: undefined
-      }
-      this.queryParam.subareaArea = {
         subareaSn: undefined,
-        subareaAreaSn: undefined,
-        bizUserSn: undefined
+        subareaAreaSn: undefined
       }
+      this.queryParam.dealerSn = undefined
       this.$refs.areaList.clearData()
       this.$refs.subarea.clearData()
       this.$refs.table.refresh(true)
     },
-    //  产品分类  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] : ''
-    },
-    // 仓库下拉数据
-    getWarehouseList () {
-      checkWarehouseWarehouse({}).then(res => {
-        if (res.status == 200) {
-          this.warehouseList = res.data
-        } else {
-          this.warehouseList = []
-        }
-      })
-    },
     //  导出
     handleExport () {
       const _this = this
-      _this.$store.state.app.curActionPermission = 'B_sales_export'
       _this.exportLoading = true
       _this.spinning = true
-      hdExportExcel(checkWarehouseDetailExport, _this.queryParam, '销售明细', function () {
+      hdExportExcel(dealerExport, _this.queryParam, '促销经销商列表导出', function () {
         _this.exportLoading = false
         _this.spinning = false
         _this.showExport = true
-        _this.$store.state.app.curActionPermission = ''
-      })
-    },
-    // 打印导出
-    handlePrint (type, data) {
-      if (type == 'export') {
-        this.exportShow = false
-        this.nowType = type
-        this.handleOk(data)
-      } else {
-        this.nowType = type
-        this.openPrintModal = true
-      }
-    },
-    handleOk (objs) {
-      const _this = this
-      let params, type
-      let url = checkWarehouseDetailPrint //  打印
-      if (this.nowType == 'export') { //  导出
-        url = checkWarehouseDetailExport
-        params = { checkWarehouseSn: this.itemSn, ...objs }
-        type = 'export'
-      } else { //  打印
-        params = JSON.parse(JSON.stringify(objs))
-        params.printType = this.printerType
-        type = params.type
-        delete params.type
-      }
-      _this.spinning = true
-      // 打印或导出
-      hdPrint(this.printerType, type, url, params, '库存盘点', function () {
-        _this.spinning = false
       })
     }
   },
@@ -287,25 +189,8 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
-        this.printerType = 'NEEDLE'
-        this.$refs.table.clearTable()
-        this.basicInfoData = null
-      } else {
-        const _this = this
-        setTimeout(() => (
-          _this.resetSearchForm()
-        ), 300)
+        this.resetSearchForm()
       }
-    },
-    itemSn (newValue, oldValue) {
-      if (this.isShow && newValue) {
-        this.isPrice = false
-        this.getDetail()
-        this.getWarehouseList()
-      }
-    },
-    isPrice (newValue, oldValue) {
-      this.$refs.table.refresh(true)
     }
   }
 }

+ 5 - 3
src/views/promotionRulesManagement/promotionManagement/promotionDescModal.vue

@@ -9,9 +9,7 @@
     @cancel="isShow=false"
     :width="500">
     <div class="promotionDesc-con">
-      <p>购买满 10000 元正价产品,送 1000 元代金券可用于购买促销品</p>
-      <p>购买满 20000 元正价产品,返 3000 元代金券可用于购买促销品</p>
-      <p>正价消费满 1000 元 减 500 元</p>
+      {{ con }}
     </div>
     <div class="btn-cont">
       <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
@@ -28,6 +26,10 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    con: {
+      type: String,
+      default: ''
     }
   },
   data () {

+ 26 - 6
src/views/promotionRulesManagement/promotionManagement/promotionShowModal.vue

@@ -7,13 +7,26 @@
     :title="modalTit"
     v-model="isShow"
     @cancel="isShow=false"
-    :width="500">
-    <div class="promotionDesc-con">
-      <img src="https://img0.baidu.com/it/u=107997771,2476879867&fm=253&fmt=auto&app=138&f=JPEG?w=716&h=500" alt="图片走丢了" srcset="">
+    :width="750">
+    <div class="promotionDesc-con" v-if="imgList&&imgList.length>0">
+      <a-carousel arrows>
+        <div
+          slot="prevArrow"
+          slot-scope="props"
+          class="custom-slick-arrow"
+          style="left: 10px;zIndex: 1"
+        >
+          <a-icon type="left-circle" />
+        </div>
+        <div slot="nextArrow" slot-scope="props" class="custom-slick-arrow" style="right: 10px">
+          <a-icon type="right-circle" />
+        </div>
+        <img :src="con" alt="图片走丢了" v-for="(con,i) in imgList" :key="i" />
+      </a-carousel>
     </div>
     <div class="btn-cont">
-      <a-button id="promotionDesc-modal-back" @click="isShow = false">下载图片</a-button>
-      <a-button style="margin-left:10px;" type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
+      <!-- <a-button style="margin-right:10px;"  id="promotionDesc-modal-back" @click="isShow = false">下载图片</a-button> -->
+      <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
     </div>
   </a-modal>
 </template>
@@ -27,6 +40,12 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
+    },
+    imgList: { //  弹框显示状态
+      type: Array,
+      default: function () {
+        return []
+      }
     }
   },
   data () {
@@ -60,7 +79,8 @@ export default {
       overflow-y: scroll;
       img{
          width:100%;
-         height:auto;
+          height:600px;
+         object-fit:cover;
        }
     }
     .btn-cont {