Quellcode durchsuchen

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

lilei vor 1 Jahr
Ursprung
Commit
3ae197e711

+ 47 - 0
src/api/promotion.js

@@ -158,3 +158,50 @@ export const downDealerFail = (params) => {
     responseType: 'blob'
   })
 }
+
+// 创建人   列表查询
+export const queryCreatorList = (params) => {
+  return axios({
+    url: '/promotion/queryCreatorList',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 复制  经销商促销列表
+export const handleCopyData = (params) => {
+  return axios({
+    url: '/promotion/copyData',
+    data: params,
+    method: 'post'
+  })
+}
+
+//经销商促销  已选参与客户  列表查询  分页
+export const queryAuditPageList = (params) => {
+  const url = `/promotion/dealer/queryAuditPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+//参与客户 提交审核
+export const dealerMidwayAudit = (params) => {
+  return axios({
+    url: '/promotion/dealer/midwayAudit',
+    data: params,
+    method: 'post'
+  })
+}
+//参与客户   更新列表
+export const dealerMidwayUpdate = (params) => {
+  return axios({
+    url: '/promotion/dealer/midwayUpdate',
+    data: params,
+    method: 'post'
+  })
+}

+ 83 - 0
src/views/common/creatorList.vue

@@ -0,0 +1,83 @@
+<template>
+  <a-select
+    show-search
+    label-in-value
+    :size="size"
+    :value="creatorName"
+    :placeholder="placeholder"
+    style="width: 100%"
+    :filter-option="false"
+    :not-found-content="fetching ? undefined : null"
+    :dropdownMatchSelectWidth="false"
+    @search="fetchUser"
+    @change="handleChange"
+    allowClear
+    :disabled="disabled"
+  >
+    <a-spin v-if="fetching" slot="notFoundContent" size="small" />
+    <a-select-option v-for="item in data" :key="item.creatorId" :value="item.creatorId">
+      {{ item.creatorName }}
+    </a-select-option>
+  </a-select>
+</template>
+<script>
+import debounce from 'lodash/debounce'
+import { dealerDetailBySn } from '@/api/dealer'
+import { queryCreatorList } from '@/api/promotion'
+export default {
+  props: {
+    size: {
+      type: String,
+      default: 'default'
+    },
+    placeholder: {
+      type: String,
+      default: '请输入创建人名称搜索'
+    },
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    this.lastFetchId = 0
+    this.fetchUser = debounce(this.fetchUser, 800)
+    return {
+      data: [],
+      creatorName: [],
+      fetching: false
+    }
+  },
+  methods: {
+    fetchUser (likeCreatorName) {
+      if (likeCreatorName == '') return
+      this.lastFetchId += 1
+      const fetchId = this.lastFetchId
+      this.data = []
+      this.fetching = true
+      queryCreatorList({ creatorName: likeCreatorName.replace(/\s+/g, '') }).then(res => {
+        if (fetchId !== this.lastFetchId) {
+          return
+        }
+        this.data = res.data ? res.data : []
+        this.fetching = false
+      })
+    },
+    handleChange (value) {
+      if (value && value.key) {
+        const obj = this.data.find(item => item.creatorId == value.key)
+        value.name = obj.creatorName
+      }
+      Object.assign(this, {
+        creatorName: value,
+        data: [],
+        fetching: false
+      })
+      this.$emit('change', value || { key: undefined })
+    },
+    resetForm () {
+      this.creatorName = []
+    }
+  }
+}
+</script>

+ 9 - 9
src/views/promotionRulesManagement/dealerPromotions/addModal.vue

@@ -116,7 +116,7 @@ import { Upload } from '@/components'
 import department from '@/views/expenseManagement/expenseReimbursement/department.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
 import moment from 'moment'
-import chooseDealer from '../promotionManagement/chooseDealer'
+import chooseDealer from './chooseDealer'
 import importDealerModa from './importDealerModa.vue'
 import { dealerPromotionSave, dealerPromotionInfo, dealerPromotionEdit } from '@/api/promotion'
 export default {
@@ -148,7 +148,7 @@ export default {
         description: '', // 活动简称
         content: '', // 活动描述
         attachmentList: '', // 附件
-        dealerSnList: [], // 参与客户
+        promotionDealerList: [], // 参与客户
         dealerScope: 'SOME_DEALER' // 全部客户   部分客户
       },
       openDealerModal: false,
@@ -194,7 +194,7 @@ export default {
       this.openDealerModal = true
       const _this = this
       if (_this.chooseDealerList.length == 0) {
-        _this.form.dealerSnList = []
+        _this.form.promotionDealerList = []
       }
       const arr = _this.chooseDealerList.map(item => {
         return item.dealerSn
@@ -214,7 +214,7 @@ export default {
       this.chooseDealerList = list
       this.openDealerModal = false
       // 移除表单必填项
-      this.$refs.ruleForm.clearValidate('dealerSnList')
+      this.$refs.ruleForm.clearValidate('promotionDealerList')
     },
     //  新增/编辑
     handleSave () {
@@ -222,16 +222,16 @@ export default {
       if (_this.form.dealerScope === 'SOME_DEALER') {
         if (_this.chooseDealerList && _this.chooseDealerList.length > 0) {
           const newArr = this.chooseDealerList.map(item => {
-            return item.dealerSn
+            return { dealerSn: item.dealerSn, dealerScope: this.form.dealerScope }
           })
-          _this.form.dealerSnList = newArr
+          _this.form.promotionDealerList = newArr
         } else {
           _this.$message.error('请选择参与客户')
           return
         }
       } else {
         this.form.dealerList = []
-        this.form.dealerSnList = []
+        this.form.promotionDealerList = []
       }
 
       this.$refs.ruleForm.validate(valid => {
@@ -272,7 +272,7 @@ export default {
         description: '', // 活动简称
         content: '', // 活动描述
         attachmentList: '', // 附件
-        dealerSnList: [], // 参与客户
+        promotionDealerList: [], // 参与客户
         dealerScope: 'SOME_DEALER'
       }
       this.attachList = []
@@ -288,7 +288,7 @@ export default {
         if (res.status == 200) {
           const data = res.data
           this.chooseDealerList = data.dealerList
-          data.dealerSnList = data.dealerSnList
+          data.promotionDealerList = data.promotionDealerList
           data.activeDate = [data.promotionDateStart, data.promotionDateEnd]
           if (data.attachmentList) {
             this.attachList = data.attachmentList

+ 232 - 0
src/views/promotionRulesManagement/dealerPromotions/chooseDealer.vue

@@ -0,0 +1,232 @@
+<template>
+  <a-spin :spinning="spinning" tip="Loading...">
+    <!-- 搜索条件 -->
+    <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
+      <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
+        <a-row :gutter="15">
+          <a-col :md="8" :sm="24">
+            <a-form-model-item label="地区">
+              <AreaList id="viewDealers-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="经销商名称/别名">
+              <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="商户类型">
+              <v-select code="DEALER_TYPE" id="chooseDealer-dealerType" v-model="queryParam.dealerType" allowClear placeholder="请选择商户类型"></v-select>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-model-item label="商户级别" prop="dealerLevel">
+              <v-select code="DEALER_LEVEL" id="ucModal-dealerLevel" v-model="queryParam.dealerLevel" allowClear placeholder="请选择商户级别"></v-select>
+            </a-form-model-item>
+          </a-col>
+          <a-col :md="8" :sm="24">
+            <a-form-item label="所在区域/分区">
+              <subarea id="chooseDealer-subarea" ref="subarea" @change="subareaChange"></subarea>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8" :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 :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 { queryAuditPageList } from '@/api/promotion'
+import { getDealerListInfo } from '@/api/dealer'
+export default {
+  name: 'ChooseDealer',
+  mixins: [commonMixin],
+  components: { STable, VSelect, subarea, AreaList },
+  props: {
+    parentData: {
+      type: Object,
+      default: function () {
+        return null
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      queryParam: { //  查询条件
+        nameLike: '',
+        dealerType: null,
+        dealerLevel: null,
+        subareaArea: {
+          subareaSn: undefined, //  区域
+          subareaAreaSn: undefined // 分区
+        },
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined
+      },
+      pagination: {
+        pageSize: 20,
+        showSizeChanger: true,
+        pageSizeOptions: ['20', '50', '100', '200', '500']
+      },
+      pageFlag: false,
+      chooseInfo: [],
+      selectedRowKeys: [],
+      dealerList: [],
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      loading: false, // 批量添加loading,
+      columns: [
+        { title: '地区', scopedSlots: { customRender: 'addressInfo' }, width: '30%', align: 'center', ellipsis: true },
+        { title: '经销商名称', dataIndex: 'dealerName', width: '30%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户别名', dataIndex: 'dealerAlias', align: 'left', width: '30%', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '15%', 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 || '--' } }
+      ]
+    }
+  },
+  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 }
+      queryAuditPageList(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
+          }
+          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
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam = {
+        nameLike: '',
+        dealerType: null,
+        dealerLevel: null,
+        subareaArea: {
+          subareaSn: undefined, //  区域
+          subareaAreaSn: undefined // 分区
+        },
+        auditState: undefined,
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined
+      }
+      this.$refs.subarea.clearData()
+      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)
+    },
+    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>

+ 68 - 23
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -40,14 +40,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="创建人">
-                <v-select
-                  v-model="queryParam.state"
-                  ref="state"
-                  id="promotionList-state"
-                  code="PROMOTION_STATE"
-                  placeholder="请选择创建人"
-                  allowClear
-                ></v-select>
+                <creatorList ref="creatorList" id="promotionList-creatorId" @change="creatorChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -101,9 +94,10 @@
           </template>
           <!-- 参与客户 -->
           <template slot="joinCustomers" slot-scope="text, record">
-            <span v-if="record.dealerScope ==='ALL_DEALER'">全部客户</span>
+            <span class="joinCustomer" v-if="record.dealerScope ==='ALL_DEALER'" @click="handleCustomers(record)">全部客户</span>
             <span class="joinCustomer" v-else @click="handleCustomers(record)">共有<span style="color:#39f;vertical-align:top;">{{ record.dealerSnList?record.dealerSnList.length:0 }}</span>个客户</span>
-            <a-badge count="审" :number-style="{ backgroundColor: '#f30', zoom:'80%' }" />
+            <a-badge count="审" v-show="record.dealerAuditFlag == 1" :number-style="{ backgroundColor: '#f30', zoom:'80%' }" />
+            <!-- dealerAuditFlag  1 是 0否 -->
           </template>
           <!-- 发布状态 -->
           <template slot="releaseStatus" slot-scope="text, record">
@@ -163,14 +157,15 @@
             <a-button
               size="small"
               type="link"
-              @click="openCopyModal = true"
+              v-if="record.state != 'AUDIT_REJECT'"
+              @click="handleCopyModal(record)"
               class="button-info"
               id="promotionList-edit-btn">复制</a-button>
           </template>
         </s-table>
       </a-spin>
       <!-- 参与客户 -->
-      <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
+      <lookUp-customers-modal :itemSn="itemPromotionSn" ref="lookUpCustomers" :openModal="openCustomerModal" @ok="editCustomerOk" @close="openCustomerModal = false"></lookUp-customers-modal>
       <!-- 新增/编辑弹窗-->
       <add-modal v-drag :itemSn="itemSn" :openModal="openModal" @ok="handleOk" @close="openModal=false" />
       <!-- 促销时间变更 -->
@@ -222,13 +217,13 @@
           <a-button
             id="copyModal-cancel"
             class="button-cancel"
-            @click="closeAuditModal"
+            @click="closeCopyModal"
             style="margin-right: 15px;">取消</a-button>
           <a-button
             type="primary"
             id="copyModal-save"
             class="button-primary"
-            @click="handleAuditModal"
+            @click="handleCopy"
           >确定</a-button>
         </div>
       </a-modal>
@@ -240,16 +235,17 @@
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
 import addModal from './addModal.vue'
-import lookUpCustomersModal from '../promotionManagement/lookUpCustomersModal'
+import lookUpCustomersModal from './lookUpCustomersModal'
 import rangeDate from '@/views/common/rangeDate.vue'
+import creatorList from '@/views/common/creatorList.vue'
 import editActiveEndTime from './editActiveEndTime.vue'
 import supplier from '@/views/common/supplier.js'
 import warehouse from '@/views/common/chooseWarehouse.js'
-import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver } from '@/api/promotion'
+import { dealerPromotionList, dealerPromotionDel, modifyEnabledFlag, promotionAudit, promotionIsOver, handleCopyData, dealerMidwayAudit } from '@/api/promotion'
 export default {
   name: 'PromotionManagementList',
   mixins: [commonMixin],
-  components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime },
+  components: { STable, supplier, VSelect, rangeDate, warehouse, lookUpCustomersModal, addModal, editActiveEndTime, creatorList },
   data () {
     return {
       spinning: false,
@@ -265,7 +261,8 @@ export default {
         endDate: undefined,
         queryWord: '',
         enabledFlag: undefined, // 发布状态
-        state: undefined
+        state: undefined,
+        creatorId: undefined
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -275,6 +272,7 @@ export default {
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '13%', align: 'center' },
         { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '7%', align: 'center', ellipsis: true },
         { title: '促销描述', dataIndex: 'content', width: '15%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '创建人', dataIndex: 'creatorName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '活动状态', dataIndex: 'stateDictValue', width: '7%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '发布状态', scopedSlots: { customRender: 'releaseStatus' }, width: '7%', align: 'center', ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
@@ -299,10 +297,15 @@ export default {
       },
       itemSn: null, // 经销商促销活动SN
       openAuditModal: false, // 审核弹窗,
-      openCopyModal: false // 复制弹窗
+      openCopyModal: false, // 复制弹窗
+      itemPromotionSn: ''
     }
   },
   methods: {
+    // 创建人
+    creatorChange (val) {
+      this.queryParam.creatorId = val.key
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ name: 'dealerPromotionManagementDetail', query: { sn: row.promotionSn } })
@@ -321,7 +324,11 @@ export default {
     handleCustomers (row) {
       this.openCustomerModal = true
       this.$nextTick(() => {
-        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.dealerSnList })
+        if (row.dealerScope != 'ALL_DEALER') {
+          this.itemPromotionSn = row.promotionSn
+        } else {
+          this.itemPromotionSn = ''
+        }
       })
     },
     //  基本信息  保存
@@ -381,6 +388,30 @@ export default {
         _this.spinning = false
       })
     },
+    // 复制
+    handleCopyModal (row) {
+      this.itemSn = row.promotionSn
+      this.$nextTick(() => {
+        this.openCopyModal = true
+      })
+    },
+    handleCopy () {
+      const _this = this
+      _this.spinning = true
+      handleCopyData({ promotionSn: this.itemSn }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+        }
+        _this.itemSn = null
+        _this.openCopyModal = false
+        _this.spinning = false
+      })
+    },
+    closeCopyModal () {
+      this.itemSn = null
+      this.openCopyModal = false
+    },
     // 促销时间变更
     handleTime (row) {
       this.editEndModal = true
@@ -439,6 +470,19 @@ export default {
         }
       })
     },
+    // 修改参与客户   参与客户提交审核
+    editCustomerOk (res) {
+      const _this = this
+      dealerMidwayAudit({ promotionSn: row.promotionSn, dealerAuditStatus: '1' }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+          _this.spinning = false
+        } else {
+          _this.spinning = false
+        }
+      })
+    },
     //  重置
     resetSearchForm () {
       this.queryParam = {
@@ -450,6 +494,7 @@ export default {
       }
       this.$refs.rangeDate.resetDate()
       this.$refs.table.refresh(true)
+      // this.$refs.dealerSubareaScopeList.resetForm()
     },
 
     pageInit () {
@@ -501,9 +546,9 @@ export default {
     .nameBox{
      padding:0 5px;
     }
-    .joinCustomer{
-      cursor:pointer;
-    }
+  }
+  .joinCustomer{
+    cursor:pointer;
   }
   .copyContent{
     margin:30px 10px 20px;

+ 274 - 0
src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue

@@ -0,0 +1,274 @@
+<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" @keyup.enter.native="$refs.table.refresh(true)">
+            <a-row :gutter="15">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="地区">
+                  <AreaList id="actualSalesReportList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-model-item label="区域/分区">
+                  <subarea ref="subarea" id="salesManagementList-subarea" @change="subareaChange"></subarea>
+                </a-form-model-item>
+              </a-col>
+              <a-col :md="6" :sm="24">
+                <a-form-item label="经销商名称">
+                  <a-input id="salesManagementList-purchaseBillNo" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+                </a-form-item>
+              </a-col>
+              <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+                <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="inventoryCheckMakeInventoryList-refresh">查询</a-button>
+                <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="inventoryCheckMakeInventoryList-reset">重置</a-button>
+                <a-button
+                  style="margin-left: 10px"
+                  type="primary"
+                  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">
+            {{ record.provinceName }}/{{ record.cityName }}/{{ record.districtName }}
+          </template>
+        </s-table>
+      </a-card>
+      <div class="btn-cont">
+        <a-button type="primary" class="button-warning" @click="editDealerModal">修改</a-button>
+        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="handleSaveAudit">提交审核</a-button>
+      </div>
+    </a-spin>
+    <!-- 选择参与客户 -->
+    <a-modal
+      title="选择经销商"
+      :visible="openDealerModal"
+      :footer="null"
+      centered
+      class="lookUpCustomers-modal"
+      @cancel="openDealerModal = false"
+      width="60%"
+    >
+      <div class="dealerModalCon">
+        <chooseDealer ref="dealerChoose" pageType="dealerPromotion" @plAdd="handleAddDealer"></chooseDealer>
+      </div>
+    </a-modal>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable } from '@/components'
+import subarea from '@/views/common/subarea.js'
+import AreaList from '@/views/common/areaList.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { dealerExport } from '@/api/promoTerminal'
+import { queryAuditPageList, dealerMidwayUpdate } from '@/api/promotion'
+import chooseDealer from '../promotionManagement/chooseDealer'
+
+export default {
+  name: 'LookUpCustomersModal',
+  components: { STable, subarea, AreaList, chooseDealer },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {
+      type: String,
+      default: ''
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      exportLoading: false,
+      queryParam: {
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        dealerName: undefined
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        this.queryParam.promotionSn = this.itemSn
+        const params = Object.assign(parameter, this.queryParam)
+        const ajaxName = !this.updateFlag ? queryAuditPageList : dealerMidwayUpdate
+        return ajaxName(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: '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: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      openDealerModal: false, // 修改弹窗
+      updateFlag: false
+    }
+  },
+  methods: {
+    // 修改参与客户
+    editDealerModal () {
+      const _this = this
+      _this.openDealerModal = true
+
+      // const arr = _this.chooseDealerList.map(item => {
+      //   return item.dealerSn
+      // })
+      // // 选择参与客户回显
+      // _this.$nextTick(() => {
+      //   _this.$refs.dealerChoose.pageInit(arr)
+      // })
+    },
+    // 添加经销商
+    handleAddDealer (list) {
+      // this.chooseDealerList = list
+      // this.openDealerModal = false
+      debugger
+      this.updateFlag = true
+      this.$nextTick(() => {
+        this.$refs.table.refresh()
+      })
+    },
+    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
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam = Object.assign({
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        }
+      }, this.snObj)
+      this.queryParam.dealerName = undefined
+      this.updateFlag = false
+      this.$refs.areaList.clearData()
+      this.$refs.subarea.clearData()
+      this.$refs.table.refresh(true)
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      _this.exportLoading = true
+      _this.spinning = true
+      hdExportExcel(dealerExport, _this.queryParam, '促销经销商列表导出', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.showExport = true
+      })
+    },
+    // 提交审核
+    handleSaveAudit () {
+
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetSearchForm()
+      } else {
+        this.$refs.table.refresh(true)
+      }
+    }
+  }
+}
+</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>

+ 2 - 3
src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue

@@ -114,7 +114,7 @@ export default {
       pagination: {
         pageSize: 20,
         showSizeChanger: true,
-        pageSizeOptions: ['20','50','100','200','500']
+        pageSizeOptions: ['20', '50', '100', '200', '500']
       },
       pageFlag: false,
       chooseInfo: [],
@@ -158,7 +158,6 @@ export default {
     },
     loadData () {
       this.spinning = true
-      console.log(this.pagination)
       const params = { pageSize: 20, pageNo: 1, ...this.pagination }
       dealerQueryList(Object.assign(params, this.queryParam)).then(res => {
         let data
@@ -220,7 +219,7 @@ export default {
       } else {
         this.$refs.areaList.clearData()
       }
-      
+
       this.pagination.pageNo = 1
       this.pagination.current = 1
       this.loadData()

+ 2 - 23
src/views/promotionRulesManagement/promotionManagement/lookUpCustomersModal.vue

@@ -60,15 +60,6 @@
           <template slot="address" slot-scope="text, record">
             {{ record.provinceName }}/{{ record.cityName }}/{{ record.districtName }}
           </template>
-          <!-- 操作 -->
-          <template slot="action" slot-scope="text, record">
-            <a-button
-              size="small"
-              type="link"
-              @click="handleDel(record)"
-              class="button-error"
-              id="customersList-del-btn">删除</a-button>
-          </template>
         </s-table>
       </a-card>
       <div class="btn-cont">
@@ -143,12 +134,8 @@ export default {
       isPrice: false, //  仅显示盈亏
       openPrintModal: false,
       nowType: null,
-      printerType: 'NEEDLE' //  打印机类型
-    }
-  },
-  computed: {
-    columns () {
-      const arr = [
+      printerType: 'NEEDLE', //  打印机类型
+      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 || '--' } },
@@ -157,17 +144,9 @@ export default {
         { title: '商户类型', dataIndex: 'dealerLevelDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '商户级别', dataIndex: 'dealerTypeDictValue', width: '15%', align: 'center', customRender: function (text) { return text || '--' } }
       ]
-      if (this.snObj && this.snObj.dealerSnList && this.snObj.dealerSnList.length > 0) {
-        arr.push({ title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' })
-      }
-      return arr
     }
   },
   methods: {
-    // 删除改变状态
-    handleDel () {
-
-    },
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''