Browse Source

Merge branch 'develop_yh30' of jianguan-web/jg-ocs-html into develop_yh29

李磊 1 năm trước cách đây
mục cha
commit
24cdcfe2c6
32 tập tin đã thay đổi với 1190 bổ sung229 xóa
  1. BIN
      public/templ/促销规则导入产品.xlsx
  2. BIN
      public/templ/促销规则导入特价产品.xlsx
  3. 82 0
      src/api/promotion.js
  4. 1 1
      src/api/waitDispatchDetail.js
  5. 1 1
      src/views/bnSetting/menu/childModal.vue
  6. 1 1
      src/views/bnSetting/menu/storeMenus.vue
  7. 0 1
      src/views/common/chooseTypeModal.vue
  8. 85 0
      src/views/common/creatorList.vue
  9. 0 2
      src/views/dealerManagement/businessOwnerSettings/chooseDealer.vue
  10. 0 1
      src/views/dealerManagement/businessOwnerSettings/chooseSupplier.vue
  11. 1 1
      src/views/dealerManagement/dealerZoneSearch/list.vue
  12. 1 1
      src/views/expenseManagement/expenseReimbursementDetail/list.vue
  13. 12 12
      src/views/promotionRulesManagement/dealerPromotions/addModal.vue
  14. 237 0
      src/views/promotionRulesManagement/dealerPromotions/chooseDealer.vue
  15. 1 1
      src/views/promotionRulesManagement/dealerPromotions/editActiveEndTime.vue
  16. 2 1
      src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue
  17. 195 31
      src/views/promotionRulesManagement/dealerPromotions/list.vue
  18. 326 0
      src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue
  19. 1 9
      src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue
  20. 1 9
      src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue
  21. 3 10
      src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue
  22. 16 13
      src/views/promotionRulesManagement/dealerPromotions/tableType1.vue
  23. 13 10
      src/views/promotionRulesManagement/dealerPromotions/tableType2.vue
  24. 2 3
      src/views/promotionRulesManagement/promotionManagement/chooseDealer.vue
  25. 6 1
      src/views/salesManagement/salesCollection/voucherModal.vue
  26. 53 41
      src/views/salesManagement/salesQueryNew/comps/detailProductList.vue
  27. 2 1
      src/views/salesManagement/salesQueryNew/comps/productList.vue
  28. 31 4
      src/views/salesManagement/salesQueryNew/detail.vue
  29. 15 0
      src/views/salesManagement/waitDispatchNew/edit.vue
  30. 95 73
      src/views/salesManagement/waitDispatchNew/queryPart.vue
  31. 6 0
      src/views/supplierManagement/supplierInfo/edit.vue
  32. 1 1
      vue.config.js

BIN
public/templ/促销规则导入产品.xlsx


BIN
public/templ/促销规则导入特价产品.xlsx


+ 82 - 0
src/api/promotion.js

@@ -158,3 +158,85 @@ 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 queryDealerPage = (params) => {
+  const url = `/promotion/dealer/queryDealerPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+// 参与客户 提交审核
+export const midwaySubmit = (params) => {
+  return axios({
+    url: '/promotion/dealer/midwaySubmit',
+    data: params,
+    method: 'post'
+  })
+}
+// 参与客户   更新列表
+export const dealerMidwayUpdate = (params) => {
+  return axios({
+    url: '/promotion/dealer/midwayUpdate',
+    data: params,
+    method: 'post'
+  })
+}
+// 参与客户 审核通过  审核不通过
+export const dealerMidwayAudit = (params) => {
+  return axios({
+    url: '/promotion/dealer/midwayAudit',
+    data: params,
+    method: 'post'
+  })
+}
+// 获取所有经销商sn   全部客户回显
+export const allDealerSnList = (params) => {
+  return axios({
+    url: '/promotion/dealer/allDealerSnList',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 获取所选经销商sn
+export const updateDealerSnList = (params) => {
+  return axios({
+    url: '/promotion/dealer/updateDealerSnList',
+    data: params,
+    method: 'post'
+  })
+}

+ 1 - 1
src/api/waitDispatchDetail.js

@@ -13,7 +13,7 @@ export const deleteBatch = (params) => {
 export const pushDown = (params) => {
   return axios({
     url: `/dispatch/pushDown`,
-	data:params,
+    data:params,
     method: 'post'
   })
 }

+ 1 - 1
src/views/bnSetting/menu/childModal.vue

@@ -257,7 +257,7 @@ export default {
       const _this = this
       this.form.validateFields((err, values) => {
         if (!err) {
-          console.log(values.formData, ' formData.type222222222')
+          console.log(values.formData, ' formData.type')
           values.formData.permission = values.formData.permission.replace(/\//g, '_')
           const saveRequest = this.parentType == 'store' ? saveMdMenu : saveYyMenu
           saveRequest(Object.assign(this.formData, values.formData)).then(res => {

+ 1 - 1
src/views/bnSetting/menu/storeMenus.vue

@@ -351,7 +351,7 @@ export default {
     // 获取菜单树列表
     getMdMenuList () {
       getMdMenuList().then(res => {
-        console.log(res, 'res1111111')
+        console.log(res, 'res')
         if (res.status == 200) {
           this.treeData = res.data
           console.log(this.treeData, 'this.treeData')

+ 0 - 1
src/views/common/chooseTypeModal.vue

@@ -140,7 +140,6 @@ export default {
       }
     },
     handleAllDisabled (list) {
-      console.log('111111111:', list)
       this.chooseList = list
     },
     // 禁用递归

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

@@ -0,0 +1,85 @@
+<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 { 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 = []
+    },
+    setDefaultVal (val) {
+      this.creatorName = val
+    }
+  }
+}
+</script>

+ 0 - 2
src/views/dealerManagement/businessOwnerSettings/chooseDealer.vue

@@ -148,7 +148,6 @@ export default {
                 }
               }
             }
-            console.log('11111111111111:', chooseData)
             if (!this.pageFlag) {
               this.pageFlag = true
               _this.$refs.table.setTableSelected(_this.chooseInfo, chooseData) // 设置表格选中项
@@ -188,7 +187,6 @@ export default {
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
-      console.log('22222222222222222222:', obj)
     },
     areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''

+ 0 - 1
src/views/dealerManagement/businessOwnerSettings/chooseSupplier.vue

@@ -88,7 +88,6 @@ export default {
               }
             }
             if (!_this.pageFlag) {
-              console.log('11111111111111111111111', _this.chooseInfo, chooseData)
               _this.$refs.table.setTableSelected(_this.chooseInfo, chooseData) // 设置表格选中项
               _this.pageFlag = true
             }

+ 1 - 1
src/views/dealerManagement/dealerZoneSearch/list.vue

@@ -168,7 +168,7 @@ export default {
     // 选择经销商
     dealerChange (val) {
       this.queryParam.dealer.dealerSn = val.key
-      this.queryParam.dealer.dealerName = (val.label.replace('\n', '')).trim()
+      this.queryParam.dealer.dealerName = val.key ? (val.label.replace('\n', '')).trim() : ''
     },
     pageInit () {
       const _this = this

+ 1 - 1
src/views/expenseManagement/expenseReimbursementDetail/list.vue

@@ -12,7 +12,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="费用单号" :label-col="{ span:7 }" :wrapper-col="{ span:17}">
-              <a-input id="expenseReimbursementDetailList-expenseAccountNo" v-model.trim="queryParam.expenseAccountNo" allowClear placeholder="请输入销售单号"/>
+              <a-input id="expenseReimbursementDetailList-expenseAccountNo" v-model.trim="queryParam.expenseAccountNo" allowClear placeholder="请输入费用单号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">

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

@@ -102,7 +102,7 @@
       width="60%"
     >
       <div class="dealerModalCon">
-        <chooseDealer ref="dealerChoose" pageType="dealerPromotion" @plAdd="handleAddDealer"></chooseDealer>
+        <chooseDealer ref="dealerChoose" @plAdd="handleAddDealer"></chooseDealer>
       </div>
     </a-modal>
     <!-- 导入参与客户 -->
@@ -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,24 +214,24 @@ export default {
       this.chooseDealerList = list
       this.openDealerModal = false
       // 移除表单必填项
-      this.$refs.ruleForm.clearValidate('dealerSnList')
+      this.$refs.ruleForm.clearValidate('promotionDealerList')
     },
     //  新增/编辑
     handleSave () {
       const _this = this
       if (_this.form.dealerScope === 'SOME_DEALER') {
         if (_this.chooseDealerList && _this.chooseDealerList.length > 0) {
-          const newArr = this.chooseDealerList.map(item => {
-            return item.dealerSn
+          const newArr = _this.chooseDealerList.map(item => {
+            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 = [{ dealerScope: _this.form.dealerScope }]
+        _this.form.dealerList = []
       }
 
       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

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

@@ -0,0 +1,237 @@
+<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 { queryDealerPage } 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
+      }
+    },
+    promotionSn: {
+      type: String,
+      default: ''
+    }
+  },
+  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, promotionSn: this.promotionSn }
+
+      queryDealerPage(Object.assign(params, this.queryParam)).then(res => {
+        let data
+        if (res.status == 200) {
+          data = res.data
+          const pagination = { ...this.pagination }
+          pagination.total = Number(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>

+ 1 - 1
src/views/promotionRulesManagement/dealerPromotions/editActiveEndTime.vue

@@ -4,7 +4,7 @@
     class="editActiveEndTime-basicInfo-modal"
     :footer="null"
     :maskClosable="false"
-    title="促销时间变更"
+    title="时间变更"
     v-model="isShow"
     @cancel="isShow=false"
     :width="500">

+ 2 - 1
src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue

@@ -16,8 +16,9 @@
           </div>
           <ul>
             <li v-if="goodFlag==='1'">1) 导入的Excel文件中必须包含名为“产品编码”的列,“产品编码”必填</li>
-            <li v-else>1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填</li>
+            <li v-else>1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填,省级特价≤市级特价≤特约特价</li>
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
+            <li>3)起订类型和起订数量非必填:起订类型为空则默认为“按数量设置”,起订数量为空则默认为“1”。</li>
             <li>
               <a :href="filePath" style="margin: 5px 0 0;display: block;">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板

+ 195 - 31
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -5,17 +5,17 @@
       <div ref="tableSearch" class="table-page-search-wrapper">
         <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
           <a-row :gutter="15">
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="创建时间">
                 <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="促销名称/简称">
                 <a-input id="promotionList-queryWord" v-model.trim="queryParam.queryWord" allowClear placeholder="请输入促销名称/简称"/>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="发布状态">
                 <v-select
                   v-model="queryParam.enabledFlag"
@@ -26,7 +26,7 @@
                   allowClear></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="5" :sm="24">
+            <a-col :md="6" :sm="24">
               <a-form-item label="活动状态">
                 <v-select
                   v-model="queryParam.state"
@@ -38,7 +38,12 @@
                 ></v-select>
               </a-form-item>
             </a-col>
-            <a-col :md="4" :sm="24">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="创建人">
+                <creatorList ref="creatorList" id="promotionList-creatorId" @change="creatorChange" />
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
               <span class="table-page-search-submitButtons">
                 <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="promotionList-refresh">查询</a-button>
                 <a-button style="margin-left: 5px" @click="resetSearchForm()" :disabled="disabled" id="promotionList-reset">重置</a-button>
@@ -60,8 +65,11 @@
     <a-card size="small" :bordered="false">
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
-        <div class="table-operator" v-if="$hasPermissions('B_dealerPromotionAdd')">
-          <a-button id="promotionList-add" type="primary" @click="handleAdd">新增</a-button>
+        <div class="table-operator tableBtnSet" >
+          <a-button v-if="$hasPermissions('B_dealerPromotionAdd')" id="promotionList-add" type="primary" @click="handleAdd">新增</a-button>
+          <a-checkbox @change="handleDealerAudit" v-if="$hasPermissions('B_dealerAudit')" :checked="queryParam.dealerAuditFlag &&queryParam.dealerAuditFlag==1">
+            待审核(修改参与客户)
+          </a-checkbox>
         </div>
         <!-- 列表 -->
         <s-table
@@ -86,8 +94,10 @@
           </template>
           <!-- 参与客户 -->
           <template slot="joinCustomers" slot-scope="text, record">
-            <div v-if="record.dealerScope ==='ALL_DEALER'">全部客户</div>
-            <div class="joinCustomer" v-else @click="handleCustomers(record)">共有<span style="color:#39f;vertical-align:top;">{{ record.dealerSnList?record.dealerSnList.length:0 }}</span>个客户</div>
+            <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="审" v-show="record.dealerAuditFlag == 1 &&(record.state==='NOT_START'||record.state==='RUNNING') " :number-style="{ backgroundColor: '#F5222D', zoom:'80%' }" />
+            <!-- dealerAuditFlag  1 是 0否 -->
           </template>
           <!-- 发布状态 -->
           <template slot="releaseStatus" slot-scope="text, record">
@@ -126,10 +136,10 @@
             <a-button
               size="small"
               type="link"
-              v-if="$hasPermissions('B_editTime')&&(record.state == 'NOT_START' || record.state=='RUNNING')"
+              v-if="$hasPermissions('B_editTime')&&(record.state == 'NOT_START' || record.state=='RUNNING' ||record.state == 'IS_OVER')"
               @click="handleTime(record)"
               class="button-info"
-              id="promotionList-edit-btn">促销时间变更</a-button>
+              id="promotionList-edit-btn">时间变更</a-button>
             <a-button
               size="small"
               type="link"
@@ -144,12 +154,26 @@
               @click="handleDel(record)"
               class="button-error"
               id="promotionList-del-btn">删除</a-button>
-            <div v-if="record.state == 'IS_OVER'">--</div>
+            <a-button
+              size="small"
+              type="link"
+              v-if="record.state != 'AUDIT_REJECT' &&$hasPermissions('B_dealerPromotionCopy')"
+              @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"
+        :showType="itemStatusType"
+        ref="lookUpCustomers"
+        :openModal="openCustomerModal"
+        :chooseDealerList="chooseDealerArr"
+        @submitAudit="editCustomerOk"
+        @handleAudit="auditCustomerOk"
+        @close="closeCustomer"></lookUp-customers-modal>
       <!-- 新增/编辑弹窗-->
       <add-modal v-drag :itemSn="itemSn" :openModal="openModal" @ok="handleOk" @close="openModal=false" />
       <!-- 促销时间变更 -->
@@ -183,6 +207,34 @@
           >审核通过</a-button>
         </div>
       </a-modal>
+      <!-- 复制弹窗 -->
+      <a-modal
+        closable
+        v-model="openCopyModal"
+        :footer="null"
+        width="416px"
+        centered>
+        <div class="copyContent">
+          <p>提示:</p>
+          <p>复制选择的促销活动,将在列表生成一条相同的【待提交】的促销活动,可进行编辑!</p>
+          <p>是否确认生成?</p>
+          <p>附件无法复制,请重新上传</p>
+        </div>
+        <!-- 按钮 -->
+        <div class="copyBtn">
+          <a-button
+            id="copyModal-cancel"
+            class="button-cancel"
+            @click="closeCopyModal"
+            style="margin-right: 15px;">取消</a-button>
+          <a-button
+            type="primary"
+            id="copyModal-save"
+            class="button-primary"
+            @click="handleCopy"
+          >确定</a-button>
+        </div>
+      </a-modal>
     </a-card>
   </div>
 </template>
@@ -191,16 +243,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, midwaySubmit, dealerMidwayAudit, updateDealerSnList } 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,
@@ -216,18 +269,21 @@ export default {
         endDate: undefined,
         queryWord: '',
         enabledFlag: undefined, // 发布状态
-        state: undefined
+        state: undefined,
+        creatorId: undefined,
+        dealerAuditFlag: undefined
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销名称', scopedSlots: { customRender: 'promotionName' }, width: '18%', align: 'left' },
-        { title: '促销简称', dataIndex: 'description', width: '14%', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '促销名称', scopedSlots: { customRender: 'promotionName' }, width: '16%', align: 'left' },
+        { title: '促销简称', dataIndex: 'description', width: '13%', align: 'left', customRender: function (text) { return text || '--' } },
         { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '13%', align: 'center' },
-        { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '7%', align: 'center', ellipsis: true },
+        { title: '参与客户', scopedSlots: { customRender: 'joinCustomers' }, width: '11%', align: 'center', ellipsis: true },
         { title: '促销描述', dataIndex: 'content', width: '15%', align: 'left', 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: '创建人', dataIndex: 'creatorName', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '活动状态', dataIndex: 'stateDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '发布状态', scopedSlots: { customRender: 'releaseStatus' }, width: '6%', align: 'center', ellipsis: true },
         { title: '操作', scopedSlots: { customRender: 'action' }, width: '10%', align: 'center' }
       ],
       // 加载数据方法 必须为 Promise 对象
@@ -249,10 +305,18 @@ export default {
         })
       },
       itemSn: null, // 经销商促销活动SN
-      openAuditModal: false // 审核弹窗
+      openAuditModal: false, // 审核弹窗,
+      openCopyModal: false, // 复制弹窗
+      itemPromotionSn: '',
+      itemStatusType: '',
+      chooseDealerArr: [] // 所选择经销商列表
     }
   },
   methods: {
+    // 创建人
+    creatorChange (val) {
+      this.queryParam.creatorId = val.key
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ name: 'dealerPromotionManagementDetail', query: { sn: row.promotionSn } })
@@ -269,10 +333,20 @@ export default {
     },
     // 参与客户
     handleCustomers (row) {
+      this.itemPromotionSn = row.promotionSn
+      if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && (row.dealerAuditFlag == 0 || row.dealerAuditFlag == 2)) {
+        this.itemStatusType = 'isEdit'
+      } else if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && row.dealerAuditFlag == 1) {
+        this.itemStatusType = 'isAudit'
+      } else {
+        this.itemStatusType = 'isClose'
+      }
+      this.getDealerSnList({ promotionSn: row.promotionSn })
+    },
+    async getDealerSnList (ajaxData) {
+      const dealerSnArr = await updateDealerSnList(ajaxData)
+      this.chooseDealerArr = dealerSnArr.data
       this.openCustomerModal = true
-      this.$nextTick(() => {
-        this.$refs.lookUpCustomers.pageInit({ dealerSnList: row.dealerSnList })
-      })
     },
     //  基本信息  保存
     handleOk () {
@@ -306,6 +380,13 @@ export default {
     handleSetRules (row) {
       this.$router.push({ name: 'dealerPromotionManagementRule', query: { type: 'rule', sn: row.promotionSn } })
     },
+    // 审核参与客户
+    handleDealerAudit (val) {
+      this.queryParam.dealerAuditFlag = val.target.checked ? '1' : undefined
+      this.$nextTick(() => {
+        this.$refs.table.refresh(true)
+      })
+    },
     // 审核
     handleCheck (row) {
       const _this = this
@@ -331,6 +412,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
@@ -389,18 +494,53 @@ export default {
         }
       })
     },
+    // 修改参与客户   参与客户提交审核
+    editCustomerOk () {
+      const _this = this
+      midwaySubmit({ promotionSn: _this.itemPromotionSn }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+        }
+      })
+    },
+    auditCustomerOk (con) {
+      const _this = this
+      dealerMidwayAudit({ promotionSn: _this.itemPromotionSn, dealerAuditStatus: con }).then(res => {
+        if (res.status == 200) {
+          _this.$message.success(res.message)
+          _this.$refs.table.refresh()
+        }
+      })
+    },
+    closeCustomer () {
+      this.openCustomerModal = false
+      this.itemPromotionSn = ''
+      this.chooseDealerArr = []
+    },
     //  重置
     resetSearchForm () {
+      // 获取创建人默认值
+      const creatorObj = this.$store.state.user.info
+      const newObj = {
+        key: creatorObj.userid,
+        name: creatorObj.userNameCN,
+        label: creatorObj.userNameCN
+      }
+      this.$refs.creatorList.setDefaultVal(newObj)
       this.queryParam = {
         beginDate: undefined,
         endDate: undefined,
         queryWord: '',
         enabledFlag: undefined, // 发布状态
-        state: undefined
+        state: undefined,
+        creatorId: creatorObj.userid,
+        dealerAuditFlag: undefined
       }
       this.$refs.rangeDate.resetDate()
       this.$refs.table.refresh(true)
     },
+
     pageInit () {
       const _this = this
       this.$nextTick(() => { // 页面渲染完成后的回调
@@ -409,12 +549,11 @@ export default {
       this.openModal = false
       this.openDetailModal = false
       this.itemSn = null
-      this.rowSelectionInfo = null
       this.$refs.table.clearTable()
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 240
+      this.tableHeight = window.innerHeight - tableSearchH - 235
     }
   },
   watch: {
@@ -450,8 +589,33 @@ export default {
     .nameBox{
      padding:0 5px;
     }
-    .joinCustomer{
-      cursor:pointer;
+  }
+  .joinCustomer{
+    cursor:pointer;
+  }
+  .copyContent{
+    margin:30px 10px 20px;
+    p{
+      margin-bottom:6px !important;
+      font-size:14px;
+    }
+    p:last-child{
+        font-size:12px;
+        color:#666;
+        text-align:right;
+    }
+  }
+  .copyBtn{
+    text-align:center;
+    button{
+      width: 45%;
+      height:40px;
+      line-height:40px;
     }
   }
+  .tableBtnSet{
+   display: flex;
+   align-items: center;
+   justify-content: space-between;
+  }
 </style>

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

@@ -0,0 +1,326 @@
+<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="queryParam.dealerName" placeholder="请输入经销商名称" allowClear/>
+                </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.dealerSn"
+          rowKeyName="dealerSn"
+          :columns="columns"
+          :data="loadData"
+          :defaultLoadData="false"
+          :scroll="{ y: 450 }"
+          :rowClassName="(record, index) => record.dataActType ==='CREATE'? 'fontRed':record.dataActType ==='DELETE'?'fontGreen':''"
+          bordered>
+          <!-- 地区 -->
+          <template slot="address" slot-scope="text, record">
+            {{ record.provinceName }}/{{ record.cityName }}/{{ record.districtName }}
+          </template>
+        </s-table>
+      </a-card>
+      <div style="text-align:right;color:#666;" v-if="showType ==='isEdit' || showType === 'isAudit'"><span v-if="showType === 'isAudit'">待审核,</span>增加的客户显示红色,删除的客户显示绿色</div>
+      <div class="btn-cont" v-if="showType ==='isEdit'">
+        <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="submitAudit">提交审核</a-button>
+      </div>
+      <div class="btn-cont" v-if="showType === 'isAudit'&& $hasPermissions('B_dealerAudit')">
+        <a-button @click="handleAudit('AUDIT_REJECT')">审核不通过</a-button>
+        <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="handleAudit('AUDIT_PASS')">审核通过</a-button>
+      </div>
+      <div class="btn-cont" v-if="showType === 'isAudit' && !$hasPermissions('B_dealerAudit')">
+        <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</a-button>
+      </div>
+      <div class="btn-cont" v-if="showType === 'isClose'">
+        <a-button id="lookUpCustomers-modal-back" @click="isShow = false">关闭</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" :promotionSn="itemSn" @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 './chooseDealer'
+
+export default {
+  name: 'LookUpCustomersModal',
+  components: { STable, subarea, AreaList, chooseDealer },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    itemSn: {// 促销sn
+      type: String,
+      default: ''
+    },
+    showType: {
+      type: String,
+      default: ''
+    },
+    chooseDealerList: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      isShow: this.openModal, //  是否打开弹框
+      disabled: false,
+      exportLoading: false,
+      queryParam: {
+        subareaArea: {
+          subareaSn: undefined,
+          subareaAreaSn: undefined
+        },
+        provinceSn: undefined,
+        citySn: undefined,
+        districtSn: undefined,
+        dealerName: ''
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        this.queryParam.promotionSn = this.itemSn
+        const params = Object.assign(parameter, this.queryParam)
+        return queryAuditPageList(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
+      // 选择参与客户回显
+      _this.$nextTick(() => {
+        _this.$refs.dealerChoose.pageInit(arr)
+      })
+    },
+    // 添加经销商
+    handleAddDealer (list) {
+      const newArr = []
+      const dealerSnArr = []
+      list.forEach(item => {
+        const obj = {
+          dealerScope: this.itemSn ? 'SOME_DEALER' : 'ALL_DEALER',
+          dealerSn: item.dealerSn
+        }
+        newArr.push(obj)
+        dealerSnArr.push(item.dealerSn)
+      })
+      this.openDealerModal = false
+      this.chooseDealerList = dealerSnArr
+      this.updateDataList(newArr)
+    },
+    // 更新列表显示状态
+    updateDataList (list) {
+      const ajaxData = {
+        promotionSn: this.itemSn ? this.itemSn : undefined,
+        promotionDealerList: list
+      }
+      dealerMidwayUpdate(ajaxData).then(res => {
+        if (res.status == 200) {
+          this.$message.success(res.message)
+          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
+        },
+        dealerName: ''
+      }, this.snObj)
+      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
+      _this.queryParam.dealerSnList = this.chooseDealerList
+      const paramsData = _this.queryParam
+      hdExportExcel(dealerExport, paramsData, '促销经销商列表导出', function () {
+        _this.exportLoading = false
+        _this.spinning = false
+        _this.showExport = true
+      })
+    },
+    // 提交审核
+    submitAudit () {
+      this.$emit('submitAudit')
+      this.isShow = false
+    },
+    handleAudit (statusInfo) {
+      this.$emit('handleAudit', statusInfo)
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+      } else {
+        this.$nextTick(() => {
+          this.resetSearchForm()
+        })
+      }
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .lookUpCustomers-modal{
+    .ant-modal-body{
+      padding: 0 24px 24px;
+    }
+    .redBg-row{
+      background-color: #f5cdc8;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 5px 0 10px;
+    }
+    .table-page-search-wrapper{
+      margin-bottom:6px;
+      /deep/.ant-select-selection{
+        border:0 !important;
+        box-shadow: none !important;
+      }
+      .ant-form.ant-form-inline .ant-form-item{
+        border:1px solid #dadada;
+        border-radius: 3px;
+        overflow: hidden;
+        margin-bottom: 10px!important;
+        /deep/.ant-form-item-label{
+          padding-left: 11px !important;
+          padding-right: 0!important;
+        }
+      }
+    }
+   /deep/.fontRed{
+     color:red;
+   }
+   /deep/.fontGreen{
+     color:green;
+   }
+  }
+
+</style>

+ 1 - 9
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -260,16 +260,8 @@ export default {
       this.openGuideModal = false
     },
     hanldeOk (arr) {
-      const resultArr = []
-      arr.forEach(item => {
-        const obj = {
-          productCode: item.productCode,
-          productSn: item.product.productSn
-        }
-        resultArr.push(obj)
-      })
       const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
-      this.$refs[name + 'Product'].importRow(resultArr)
+      this.$refs[name + 'Product'].importRow(arr)
     },
     // 计算百分比
     calculatePrice () {

+ 1 - 9
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -292,16 +292,8 @@ export default {
       this.openGuideModal = false
     },
     hanldeOk (arr) {
-      const resultArr = []
-      arr.forEach(item => {
-        const obj = {
-          productCode: item.productCode,
-          productSn: item.product.productSn
-        }
-        resultArr.push(obj)
-      })
       const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
-      this.$refs[name + 'Product'].importRow(resultArr)
+      this.$refs[name + 'Product'].importRow(arr)
     },
     // 限制正价产品款数
     onChange (e) {

+ 3 - 10
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -482,15 +482,8 @@ export default {
       // 门槛产品导入
       const resultArr = []
       if (this.chooseVal == 'a') {
-        arr.forEach(item => {
-          const obj = {
-            productCode: item.productCode,
-            productSn: item.product.productSn
-          }
-          resultArr.push(obj)
-        })
         const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
-        this.$refs[name + 'Product'].importRow(resultArr)
+        this.$refs[name + 'Product'].importRow(arr)
       } else {
         // 特价产品导入
         const dataList = this.setShowData('This')
@@ -592,8 +585,8 @@ export default {
             provinceDiscountPrice: item.provinceDiscountPriceText,
             cityDiscountPrice: item.cityDiscountPriceText,
             specialDiscountPrice: item.specialDiscountPriceText,
-            unitType: 'SL',
-            unitQty: 1,
+            unitType: item.unitType,
+            unitQty: item.unitQty,
             provinceDiscountRate: item.provinceDiscountRate ? item.provinceDiscountRate : undefined,
             cityDiscountRate: item.cityDiscountRate ? item.cityDiscountRate : undefined,
             specialDiscountRate: item.specialDiscountRate ? item.specialDiscountRate : undefined

+ 16 - 13
src/views/promotionRulesManagement/dealerPromotions/tableType1.vue

@@ -173,6 +173,7 @@ import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
 import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
 import chooseProductsModal from './chooseProductsModal.vue'
 import { getNewScopeSn } from '@/api/promotion'
+import { forEach } from 'core-js/library/es6/array'
 export default {
   name: 'TableType1',
   mixins: [commonMixin],
@@ -231,23 +232,25 @@ export default {
       const _this = this
       const dataList = _this.setShowData('This')
       dataList.forEach(item => {
-        const pos = list.indexOf(con => con.productSn == item.goodsSn)
+        const pos = list.indexOf(con => item.product.productSn == item.goodsSn)
         list.splice(pos, 1)
       })
       if (list.length > 0) {
-        _this.spinning = true
-        getNewScopeSn({}).then(res => {
-          if (res.status == 200) {
-            const newData = {
-              productScopeSn: res.data,
-              productThisList: list,
-              unitType: 'SL',
-              unitQty: 1
+        list.forEach(con => {
+          getNewScopeSn({}).then(res => {
+            if (res.status == 200) {
+              const newData = {
+                productScopeSn: res.data,
+                productThisList: [{
+                  productCode: con.productCode,
+                  productSn: con.product.productSn
+                }],
+                unitType: con.unitType,
+                unitQty: con.unitQty
+              }
+              _this.dataSource.push(newData)
             }
-            _this.dataSource.push(newData)
-          } else {
-            _this.spinning = false
-          }
+          })
         })
       } else {
         _this.$message.warning('请勿导入重复数据!')

+ 13 - 10
src/views/promotionRulesManagement/dealerPromotions/tableType2.vue

@@ -205,20 +205,23 @@ export default {
       const _this = this
       const dataList = _this.setShowData('This')
       dataList.forEach(item => {
-        const pos = list.indexOf(con => con.productSn == item.goodsSn)
+        const pos = list.indexOf(con => item.product.productSn == item.goodsSn)
         list.splice(pos, 1)
       })
       if (list.length > 0) {
-        getNewScopeSn({}).then(res => {
-          if (res.status == 200) {
-            const newData = {
-              productScopeSn: res.data,
-              productThisList: list
+        list.forEach(con => {
+          getNewScopeSn({}).then(res => {
+            if (res.status == 200) {
+              const newData = {
+                productScopeSn: res.data,
+                productThisList: [{
+                  productCode: con.productCode,
+                  productSn: con.product.productSn
+                }]
+              }
+              _this.dataSource.push(newData)
             }
-            _this.dataSource.push(newData)
-          } else {
-            _this.spinning = false
-          }
+          })
         })
       } else {
         _this.$message.warning('请勿导入重复数据!')

+ 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()

+ 6 - 1
src/views/salesManagement/salesCollection/voucherModal.vue

@@ -232,7 +232,12 @@ export default {
         retArr.push({ audit: auditStr, detail: detailItemUseStr, subList: rs })
       })
       console.log(retArr, '------------')
-      this.handlePrint(retArr, rows)
+      if(retArr.length){
+        this.handlePrint(retArr, rows)
+      }else{
+        this.$message.info("此收款单明细为空或没有相关数据权限")
+        this.spinning = false
+      }
     },
     // 收款打印
     handlePrint (row, list) {

+ 53 - 41
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -51,6 +51,10 @@
           type: String,
           default: ''
         },
+        promoFlag: {
+          type: String,
+          default: ''
+        },
         salesBillSn: {
           type: String,
           default: ''
@@ -101,6 +105,7 @@
           showEmpty: false,
           showTableHead: true,
           colspanNums: 13,
+          hasOutStockOfActive: false,
           simpleImage: Empty.PRESENTED_IMAGE_SIMPLE
         }
       },
@@ -278,62 +283,66 @@
             const params = {
                 salesBillSn: this.salesBillSn,
                 showStock: this.showStock,
-                warehouseSn: this.warehouseSn
+                warehouseSn: this.warehouseSn,
+                promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
             }
             const active = this.activeList.filter(item => item.enabledFlag == 1)
 
             // 正常产品
-            const proList = await salesDetailAllList(params).then(res => res.data)
-            const norTotal = await salesDetaiCount(params).then(res => res.data)
+            const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
+            const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
+            const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
             // 没有活动时,表格不显示统计数据
             let listData = active.length ? (proList.length ? [{
                 id: 'promo-normal',
                 total: norTotal
               },...proList] : []) : proList
             
-            // 循环获取活动产品
-            for(let i=0;i<active.length;i++){
-              const promo = active[i]
-              const activeParams = {
-                promoRuleSn: promo.promoRuleSn,
-                promoSn: promo.promoSn,
-                salesPromoSn: promo.salesPromoSn,
-                ...params
-              }
-              
-              // 获取活动产品统计
-              const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-              if(acTotal){
-                // 采购额结余
-                acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
-                // 采购额超出
-                acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
-              }
-              // 有数据时才调用接口,避免做无用的调用
-              if(acTotal&&acTotal.totalQty){
-                // 获取活动产品列表
-                const aclist = await salesDetailAllList(activeParams).then(res => res.data)
-                const retList = aclist.length ? [{
-                  id: 'promo-'+i,
-                  promo: promo,
-                  total: acTotal
-                },...aclist] : []
-                // 将活动产品数据拼接
-                listData = aclist&&aclist.length ? listData.concat(retList) : listData
+            if(params.promotionFlag != 0){  
+              // 循环获取活动产品
+              for(let i=0;i<active.length;i++){
+                const promo = active[i]
+                const activeParams = {
+                  promoRuleSn: promo.promoRuleSn,
+                  promoSn: promo.promoSn,
+                  salesPromoSn: promo.salesPromoSn,
+                  ...params
+                }
+                
+                // 获取活动产品统计
+                const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+                if(acTotal){
+                  // 采购额结余
+                  acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
+                  // 采购额超出
+                  acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
+                }
+                // 有数据时才调用接口,避免做无用的调用
+                if(acTotal&&acTotal.totalQty){
+                  // 获取活动产品列表
+                  const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+                  
+                  const retList = aclist.length ? [{
+                    id: 'promo-'+i,
+                    promo: promo,
+                    total: acTotal
+                  },...aclist] : []
+                  // 将活动产品数据拼接
+                  listData = aclist&&aclist.length ? listData.concat(retList) : listData
+                }
               }
-            }
-            console.log(listData)
-            // 如果活动没有任何产品,不显示统计一行
-            if(active.length){
-              const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
-              if(hasAcp && hasAcp.length==0){
-                listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+              console.log(listData)
+              // 如果活动没有任何产品,不显示统计一行
+              if(active.length){
+                const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
+                if(hasAcp && hasAcp.length==0){
+                  listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+                }
               }
             }
-
             console.log(listData)
             this.dataSource = listData
-
+            
             // 格式化数据
             let f = 0
             this.outStockStr = ''
@@ -352,6 +361,9 @@
               item.epushedQty = Number(item.pushedQty) - Number(item.pushQty)
               if (item.unpushedQty && (Number(item.stockQty) < Number(item.unpushedQty))) {
                   str += item.productCode + '、'
+                  if(item.promotionFlag != 0){
+                    this.hasOutStockOfActive = true
+                  }
               }
             })
             if (str.length > 0) {

+ 2 - 1
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -413,7 +413,8 @@ export default {
       descDetail: null,
       promoProductClz: null, // 活动产品分类
       disablePromo: false,
-      countData: null
+      countData: null,
+      warehouseTit: ''
     }
   },
   computed: {

+ 31 - 4
src/views/salesManagement/salesQueryNew/detail.vue

@@ -95,11 +95,32 @@
             <div style="flex-grow: 1;width: 60%;">
               <a-form layout="inline" @keyup.enter.native="searchTable">
                 <a-row :gutter="15" type="flex">
-                  <a-col flex="350px">
+                  <a-col flex="300px">
                     <a-form-item label="出库仓库">
                       <chooseWarehouse ref="warehouse" v-model="warehouseSn"></chooseWarehouse>
                     </a-form-item>
                   </a-col>
+                  <a-col flex="300px" v-if="hasPrompActive">
+                    <a-form-item label="产品类型">
+                      <a-select v-model.trim="promoFlag" allowClear :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
+                        <a-select-option value="0">
+                          正常产品
+                        </a-select-option>
+                        <a-select-option value="REGULAR">
+                          正价产品(活动)
+                        </a-select-option>
+                        <a-select-option value="DISCOUNT">
+                          特价产品
+                        </a-select-option>
+                        <a-select-option value="GIFT">
+                          促销产品
+                        </a-select-option>
+                        <a-select-option value="GATE">
+                          门槛产品
+                        </a-select-option>
+                      </a-select>
+                    </a-form-item>
+                  </a-col>
                   <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
                     <a-button type="primary" @click="searchTable" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
                     <a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
@@ -119,6 +140,7 @@
             ref="productList"
             :detailData="detailData"
             :warehouseSn="warehouseSn"
+            :promoFlag="promoFlag"
             :salesBillSn="$route.params.sn || bizSn"
             :authCode="authCode"
             :maxHeight="pageHeight"
@@ -245,7 +267,8 @@ export default {
       spinningAudit: false,
       auditText: null,
       fromRouter: null,
-      warehouseSn: undefined
+      warehouseSn: undefined,
+      promoFlag: undefined
     }
   },
   computed: {
@@ -265,6 +288,9 @@ export default {
       const detailData = this.detailData
       return detailData&&(detailData.billStatus == 'HQ_CHANGE'|| (detailData.salesBillSource != 'SALES'&&detailData.billStatus == 'AUDIT_REJECT') ||detailData.billStatus == 'FINISH'||detailData.billStatus == 'OUTING_WAREHOUSE')
     },
+    hasPrompActive(){
+      return this.detailData&&this.detailData.promoFlag==1
+    },
     pageHeight () {
       return window.innerHeight - 305 + (this.hideFooter ? 45 : 0)
     }
@@ -282,6 +308,7 @@ export default {
     //  重置
     resetSearchForm () {
       this.warehouseSn = undefined
+      this.promoFlag = undefined
       setTimeout(() => {
         this.searchTable()
       }, 100)
@@ -319,10 +346,10 @@ export default {
     // 打开审核/一键审核弹框
     handleAudit (isBatch) {
       if (isBatch) { // 一键审核
-        if (this.detailData && this.detailData.promoFlag == 1 && this.$refs.productList.outStockStr != '') {
+        if (this.$refs.productList.hasOutStockOfActive) {
           this.$info({
             title: '提示',
-            content: '参加促销活动的销售单,有缺货产品,不可一键审核!',
+            content: '参加促销活动的产品存在缺货,不可一键审核!',
             centered: true
           })
           return

+ 15 - 0
src/views/salesManagement/waitDispatchNew/edit.vue

@@ -209,6 +209,21 @@ export default {
         this.spinning = false
       })
     },
+    // 一键下推
+    oneDispatch () {
+      this.isInster = true
+      this.spinning = true
+      salesDetailDispatchByOneKey({ salesBillSn: this.$route.params.salesBillSn }).then(res => {
+        if (res.status == 200) {
+          this.resetSearchForm()
+          this.$refs.partQuery.resetCurForm()
+          this.spinning = false
+        } else {
+          this.spinning = false
+        }
+        this.isInster = false
+      })
+    },
     pageInit () {
       this.$refs.partQuery.clearSelectTable()
       this.salesBillSn = this.$route.params.salesBillSn

+ 95 - 73
src/views/salesManagement/waitDispatchNew/queryPart.vue

@@ -14,20 +14,30 @@
               <a-input id="productInfoList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
             </a-form-item>
           </a-col>
-          <a-col :md="4" :sm="24">
-            <a-form-item label="是否促销品">
-              <v-select
-                code="FLAG"
-                id="productInfoList-promoFlag"
-                v-model="queryParam.promoFlag"
-                allowClear
-                placeholder="请选择是否"
-              ></v-select>
+          <a-col :md="4" :sm="24" v-if="hasPrompActive">
+            <a-form-item label="产品类型">
+              <a-select allowClear v-model.trim="queryParam.promotionFlag" :dropdownMatchSelectWidth="false" placeholder="请选择产品类型">
+                <a-select-option value="0">
+                  正常产品
+                </a-select-option>
+                <a-select-option value="REGULAR">
+                  正价产品(活动)
+                </a-select-option>
+                <a-select-option value="DISCOUNT">
+                  特价产品
+                </a-select-option>
+                <a-select-option value="GIFT">
+                  促销产品
+                </a-select-option>
+                <a-select-option value="GATE">
+                  门槛产品
+                </a-select-option>
+              </a-select>
             </a-form-item>
           </a-col>
           <a-col :md="4" :sm="24">
-            <a-form-item label="类型">
-              <a-select v-model.trim="queryParam.pushProductType" :dropdownMatchSelectWidth="false" >
+            <a-form-item label="下推类型">
+              <a-select allowClear v-model.trim="queryParam.pushProductType" :dropdownMatchSelectWidth="false" >
                 <a-select-option value="">
                   全部产品
                 </a-select-option>
@@ -50,7 +60,7 @@
           </a-col>
           <a-col :md="4" :sm="24" style="margin-bottom: 10px;">
             <a-button type="primary" @click="searchTable" :disabled="disabled" id="productInfoList-refresh">查询</a-button>
-            <a-button style="margin-left: 5px" @click="resetSearchForm" id="productInfoList-reset">重置</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm(null)" id="productInfoList-reset">重置</a-button>
           </a-col>
         </a-row>
       </a-form>
@@ -60,11 +70,11 @@
     <div style="margin-bottom: 10px;display: flex;align-items: center;" v-if="detailData">
       <div style="display: flex;align-items: center;">
         <a-button type="primary" :disabled="newLoading" class="button-info" @click="handlePlAdd">批量添加</a-button>
-        <a-button type="danger" v-if="hasPrompActive" :disabled="newLoading" @click="handleAllCancel">整单取消</a-button>
-        <a-button type="danger" v-else :disabled="newLoading" @click="handlePlCancel">批量取消</a-button>
-        <a-tooltip placement="top" v-if="hasPrompActive" style="margin-left:6px;">
+        <a-button type="primary" v-if="hasNormalProduct" ghost style="margin-left:6px;" :disabled="newLoading" @click="handlePlCancel">批量取消</a-button>
+        <a-button type="primary" v-if="hasPrompActive&&hasNoPushedActive" ghost style="margin-left:6px;" :disabled="newLoading" @click="handleAllCancel">整单取消</a-button>
+        <a-tooltip placement="top" v-if="hasPrompActive&&hasNoPushedActive" style="margin-left:6px;">
           <template slot="title">
-            <span>参加促销活动的销售单,不能单个取消产品,只能整单取消。</span>
+            <span>参加促销活动的产品,不能单独取消,只能整单取消。</span>
           </template>
           <a-icon style="font-size: 14px;" type="question-circle" />
         </a-tooltip>
@@ -149,7 +159,7 @@ export default {
         pushProductType: '', // 类型
         productCode: '', //  产品编码
         productName: '', //  产品名称
-        promoFlag: undefined, //  是否促销品
+        promotionFlag: undefined, //  是否促销品
         brandSn: undefined, //  产品品牌
         productTypeSn1: '', //  产品一级分类
         productTypeSn2: '', //  产品二级分类
@@ -162,7 +172,6 @@ export default {
       spinning: false,
       dataSource: [],
       tableData: [],
-      tableHeight: this.maxHeight,
       cellStyleOption: {
         bodyCellClass: ({ row, column, rowIndex }) => {
             if (row.id.indexOf('promo-')>=0 && column.field === "no") {
@@ -184,11 +193,19 @@ export default {
       disableSelectedRowKeys: [],
       selectedRowKeys: [],
       colspanNums: 16,
+      hasNormalProduct: false
     }
   },
   computed: {
+    tableHeight(){
+      return (this.showEmpty ? 200 : this.maxHeight) + 'px'
+    },
     hasPrompActive(){
-      return this.detailData&&this.detailData.promoFlag==1&&!this.detailData.totalCancelQty
+      return this.detailData&&this.detailData.promoFlag==1
+    },
+    hasNoPushedActive(){
+      const a = this.dataSource.filter(item => item.pushedQty>0)
+      return this.dataSource.length==0 ? false : !(a.length > 0)
     },
     checkboxOption () {
       return {
@@ -397,65 +414,62 @@ export default {
         this.queryParam.salesBillSn = this.salesBillSn
         this.queryParam.showStock = true
         const params = this.queryParam
-        if(params.promoFlag){
-          params.isGifg = params.promoFlag == 1 ? 'Y' : 'N'
-        }else{
-          params.isGifg = undefined
-        }
- 
         const active = this.activeList
-
         // 正常产品
-        const proList = await salesDetailAllList(params).then(res => res.data)
-        const norTotal = await salesDetaiCount(params).then(res => res.data)
+        const hasSearchNormal = !params.promotionFlag || params.promotionFlag == 0
+        const proList = hasSearchNormal ? await salesDetailAllList(params).then(res => res.data) : []
+        const norTotal = hasSearchNormal ? await salesDetaiCount(params).then(res => res.data) : null
+        // 是否有正常产品
+        this.hasNormalProduct = proList.length > 0
         //没有活动时不显示统计
         let listData = active.length ? (proList.length ? [{
             id: 'promo-normal',
             total: norTotal
           },...proList] : []) : proList
-         
-        // 循环获取活动产品
-        for(let i=0;i<active.length;i++){
-          const promo = active[i]
-          const activeParams = {
-            promoRuleSn: promo.promoRuleSn,
-            promoSn: promo.promoSn,
-            salesPromoSn: promo.salesPromoSn,
-            ...params
-          }
-          
-          
-          // 获取活动产品统计
-          const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
-          if(acTotal){
-            // 采购额结余
-            acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
-            // 采购额超出
-            acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
-          }
-           
-          // 有数据时才调用接口,避免做无用的调用
-          if(acTotal&&acTotal.totalQty){
-            // 获取活动产品列表
-            const aclist = await salesDetailAllList(activeParams).then(res => res.data)
-            const retList = aclist.length ? [{
-              id: 'promo-'+i,
-              promo: promo,
-              total: acTotal
-            },...aclist] : []
-            // 将活动产品数据拼接
-            listData = aclist&&aclist.length ? listData.concat(retList) : listData
+        
+        if(params.promotionFlag != 0){
+          // 循环获取活动产品
+          for(let i=0;i<active.length;i++){
+            const promo = active[i]
+            const activeParams = {
+              promoRuleSn: promo.promoRuleSn,
+              promoSn: promo.promoSn,
+              salesPromoSn: promo.salesPromoSn,
+              ...params
+            }
+            
+            
+            // 获取活动产品统计
+            const acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+            if(acTotal){
+              // 采购额结余
+              acTotal.cgejyAmount = Number(acTotal.totalPromoGiftsAmount||0) - Number(acTotal.totalUsePromoGiftsAmount||0)
+              // 采购额超出
+              acTotal.cgeccAmount = Number(acTotal.totalUsePromoGiftsAmount||0) - Number(acTotal.totalPromoGiftsAmount||0)
+            }
+             
+            // 有数据时才调用接口,避免做无用的调用
+            if(acTotal&&acTotal.totalQty){
+              // 获取活动产品列表
+              const aclist = await salesDetailAllList(activeParams).then(res => res.data)
+              const retList = aclist.length ? [{
+                id: 'promo-'+i,
+                promo: promo,
+                total: acTotal
+              },...aclist] : []
+              // 将活动产品数据拼接
+              listData = aclist&&aclist.length ? listData.concat(retList) : listData
+            }
           }
-        }
-  
-        // 如果活动没有任何产品
-        if(active.length){
-          const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
-          if(hasAcp && hasAcp.length==0){
-            listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+    
+          // 如果活动没有任何产品
+          if(active.length){
+            const hasAcp = listData.filter(item => item.id!='promo-normal').filter(item => item.id.indexOf("promo-")>=0)
+            if(hasAcp && hasAcp.length==0){
+              listData = listData.filter(item => item.id.indexOf("promo-")<0) || []
+            }
           }
         }
-        
         console.log(listData)
         this.dataSource = listData
 
@@ -479,7 +493,6 @@ export default {
           }
         })
         this.showEmpty = this.dataSource.length <= 0
-        this.tableHeight = (this.showEmpty ? 200 : this.maxHeight) + 'px'
         this.tableData = this.dataSource
         this.spinning = false
         this.disabled = false
@@ -495,8 +508,6 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.warehouseSn = undefined
-      this.queryParam.promoFlag = undefined
-      this.queryParam.isGifg = undefined
       this.productType = []
       this.dataSource = []
       this.clearSelectTable()
@@ -533,23 +544,29 @@ export default {
         return
       }
       const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.stockQty > 0)
+      const noStockRow = this.dataSource.filter(item => chooseList.includes(item.id) && !item.stockQty)
       const obj = []
+      const noObj = []
       chooseRow && chooseRow.map(item => {
         obj.push(item.salesBillDetailSn)
       })
+      noStockRow && noStockRow.map(item => {
+        noObj.push(item.productCode)
+      })
 
       if(obj.length){
         this.$confirm({
           title: '提示',
-          content: '确认要批量添加到待下推列表吗?',
+          content: <div><div style="text-align:center;padding:10px 0;font-weight:bold;">确认要批量添加到待下推列表吗?</div>{noObj.length?<div><div>总共选择了 {chooseList.length} 个产品,其中 {obj.length} 个产品可添加。</div><div> 产品 ({noObj.toString()}) 因库存为0不可添加!</div></div>:''}</div>,
           centered: true,
           closable: true,
+          class: 'confirm-center',
           onOk () {
             _this.$emit('addProduct', obj)
           }
         })
       }else{
-        _this.$message.warning('库存为0,不可添加!')
+        _this.$message.warning('所选产品库存为0,不可添加!')
       }
       
     },
@@ -575,6 +592,11 @@ export default {
         return
       }
       const chooseRow = this.dataSource.filter(item => chooseList.includes(item.id) && item.id.indexOf('promo-')<0)
+      const hasActive = chooseRow && chooseRow.filter(item => item.promotionFlag != 0)
+      if(hasActive.length>0){
+        _this.$message.warning('参与促销的产品只可进行整单取消!')
+        return
+      }
       const obj = []
       chooseRow && chooseRow.map(item => {
         obj.push({

+ 6 - 0
src/views/supplierManagement/supplierInfo/edit.vue

@@ -134,6 +134,11 @@
                     </a-radio-group>
                   </a-form-model-item>
                 </a-col>
+                <a-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
+                  <a-form-model-item label="ERP编码">
+                    <a-input v-model.trim="form.kdSupplierCode" :maxLength="50" allowClear placeholder="请输入ERP编码" />
+                  </a-form-model-item>
+                </a-col>
               </a-row>
             </a-collapse-panel>
           </a-collapse>
@@ -286,6 +291,7 @@ export default {
         deliveryCycle: '',
         settleCycle: '',
         cooperateFlag: undefined,
+        kdSupplierCode:'',
         busniessMode: '',
         busniessScope: '',
         buildDate: '',

+ 1 - 1
vue.config.js

@@ -108,7 +108,7 @@ const vueConfig = {
     // If you want to turn on the proxy, please remosve the mockjs /src/main.jsL11
     proxy: {
       '/api': {
-        // target: 'http://192.168.2.113:8660/ocs-admin',
+        // target: 'http://192.168.2.103:8602/ocs-admin',
         // target: 'https://t.ocs.360arrow.com/ocs-admin', //  练习
         target: 'https://p.ocs.360arrow.com/ocs-admin', //  预发布
         ws: false,