chenrui 7 kuukautta sitten
vanhempi
commit
ea60872080

BIN
public/templ/销售产品模板.xlsx


+ 114 - 79
src/api/salesDetailNew.js

@@ -6,8 +6,8 @@ export const salesDetailDel = (params) => {
     url: `/sales/detail/delete`,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent(params.salesPromoSn ? '删除产品(salesPromoSn:'+params.salesPromoSn+')':'删除产品')
+    headers: {
+      'module': encodeURIComponent(params.salesPromoSn ? '删除产品(salesPromoSn:' + params.salesPromoSn + ')' : '删除产品')
     }
   })
 }
@@ -33,8 +33,8 @@ export const salesDetailBatchDel = (params) => {
     url: `/sales/detail/delete/batch`,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent(params.salesPromoSn ? '批量删除产品(salesPromoSn:'+params.salesPromoSn+')':'批量删除产品')
+    headers: {
+      'module': encodeURIComponent(params.salesPromoSn ? '批量删除产品(salesPromoSn:' + params.salesPromoSn + ')' : '批量删除产品')
     }
   })
 }
@@ -44,33 +44,33 @@ export const batchTransferOfPurchaseAmount = (params) => {
     url: `/sales/detail/batchTransferOfPurchaseAmount`,
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('批量转采购额')
     }
   })
 }
 // 仓库设置
 export const updateWarehouse = (params) => {
-    return axios({
-      url: '/sales/detail/updateWarehouse',
-      method: 'post',
-      data: params,
-      headers:{
-        'module': encodeURIComponent(params.salesPromoSn ? '修改仓库(salesPromoSn:'+params.salesPromoSn+')':'修改仓库')
-      }
-    })
+  return axios({
+    url: '/sales/detail/updateWarehouse',
+    method: 'post',
+    data: params,
+    headers: {
+      'module': encodeURIComponent(params.salesPromoSn ? '修改仓库(salesPromoSn:' + params.salesPromoSn + ')' : '修改仓库')
+    }
+  })
 }
 // 删除全部已选产品
 export const deleteAll = (params) => {
-    return axios({
-      url: `/sales/detail/delete/all`,
-      method: 'post',
-      data: params,
-      headers:{
-        'module': encodeURIComponent(params.salesPromoSn ? '全部删除(salesPromoSn:'+params.salesPromoSn+')':'全部删除')
-      }
-    })
-  }
+  return axios({
+    url: `/sales/detail/delete/all`,
+    method: 'post',
+    data: params,
+    headers: {
+      'module': encodeURIComponent(params.salesPromoSn ? '全部删除(salesPromoSn:' + params.salesPromoSn + ')' : '全部删除')
+    }
+  })
+}
 
 // 新增销售明细
 export const salesDetailInsert = (params) => {
@@ -78,8 +78,8 @@ export const salesDetailInsert = (params) => {
     url: '/sales/detail/insert',
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent(params.promoRuleSn ? '添加产品(promoRuleSn:'+params.promoRuleSn+')':'添加产品')
+    headers: {
+      'module': encodeURIComponent(params.promoRuleSn ? '添加产品(promoRuleSn:' + params.promoRuleSn + ')' : '添加产品')
     }
   })
 }
@@ -89,8 +89,8 @@ export const salesBatchInsert = (params) => {
     url: `/sales/detail/insertBatch`,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent(params.promoRuleSn ? '导入产品(promoRuleSn:'+params.promoRuleSn+')':'导入产品')
+    headers: {
+      'module': encodeURIComponent(params.promoRuleSn ? '导入产品(promoRuleSn:' + params.promoRuleSn + ')' : '导入产品')
     }
   })
 }
@@ -103,7 +103,7 @@ export const salesFailExcel = (params) => {
     data: params.list,
     responseType: 'blob'
   })
-} 
+}
 // 销售详情列表分页
 export const salesDetailList = (params) => {
   const url = `/sales/detail/queryPage/${params.pageNo}/${params.pageSize}`
@@ -113,8 +113,8 @@ export const salesDetailList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent((params.promoRuleSn ? '产品明细查询(promoRuleSn:'+params.promoRuleSn+')':'产品明细查询'))
+    headers: {
+      'module': encodeURIComponent((params.promoRuleSn ? '产品明细查询(promoRuleSn:' + params.promoRuleSn + ')' : '产品明细查询'))
     }
   })
 }
@@ -128,60 +128,60 @@ export const salesDetailAllList = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-      'module': encodeURIComponent((params.promoRuleSn ? '产品明细查询(promoRuleSn:'+params.promoRuleSn+')':'产品明细查询'))
+    headers: {
+      'module': encodeURIComponent((params.promoRuleSn ? '产品明细查询(promoRuleSn:' + params.promoRuleSn + ')' : '产品明细查询'))
     }
   })
 }
 
 //  修改销售明细数量
 export const salesDetailUpdateQty = (params) => {
-    return axios({
-        url: '/sales/detail/updateQty',
-        data: params,
-        method: 'post',
-        headers:{
-          'module': encodeURIComponent(params.salesPromoSn ? '修改数量(salesPromoSn:'+params.salesPromoSn+')':'修改数量')
-        }
-    })
+  return axios({
+    url: '/sales/detail/updateQty',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent(params.salesPromoSn ? '修改数量(salesPromoSn:' + params.salesPromoSn + ')' : '修改数量')
+    }
+  })
 }
 // 销售  解析导入的文件
 export const salesParseProducts = params => {
-    return axios({
-      url: '/sales/detail/importParse',
-      data: params,
-      method: 'post'
-    })
-  }
+  return axios({
+    url: '/sales/detail/importParse',
+    data: params,
+    method: 'post'
+  })
+}
 // 禁用活动信息
 export const salesDisablePromo = params => {
-    return axios({
-      url: '/sales/detail/disablePromo',
-      data: params,
-      method: 'post',
-      headers:{
-        'module': encodeURIComponent('禁用规则')
-      }
-    })
-  }
+  return axios({
+    url: '/sales/detail/disablePromo',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('禁用规则')
+    }
+  })
+}
 // 启用活动
 export const salesEnablePromoPromo = params => {
   return axios({
     url: '/sales/detail/enablePromo',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('启用规则')
     }
   })
 }
- // 更换活动
- export const salesChangePromo = params => {
+// 更换活动
+export const salesChangePromo = params => {
   return axios({
     url: '/sales/detail/changePromo',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('更换促销活动')
     }
   })
@@ -192,7 +192,7 @@ export const salesDetailAddPromo = (params) => {
     url: '/sales/detail/addPromo',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('添加新活动')
     }
   })
@@ -203,7 +203,7 @@ export const salesDetailUpdateCancelQty = (params) => {
     url: '/sales/detail/cancleOfBatch',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('批量取消')
     }
   })
@@ -214,7 +214,7 @@ export const salesDetailCancleOfAll = (params) => {
     url: '/sales/detail/cancelAll',
     data: params,
     method: 'post',
-    headers:{
+    headers: {
       'module': encodeURIComponent('整单取消')
     }
   })
@@ -222,15 +222,15 @@ export const salesDetailCancleOfAll = (params) => {
 
 // 批量新增代发货信息
 export const insertBatchOfWaitDispatch = (params) => {
-    return axios({
-      url: '/sales/detail/pushOfBatch',
-      data: params,
-      method: 'post',
-      headers:{
-        'module': encodeURIComponent(params.salesBillDetailSnList.length==1?'添加产品':'批量添加产品')
-      }
-    })
-  }
+  return axios({
+    url: '/sales/detail/pushOfBatch',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent(params.salesBillDetailSnList.length == 1 ? '添加产品' : '批量添加产品')
+    }
+  })
+}
 
 // 缺货明细
 export const salesStockoutDetail = (params) => {
@@ -241,12 +241,12 @@ export const salesStockoutDetail = (params) => {
     url: url,
     data: params,
     method: 'post',
-    headers:{
-          'module': encodeURIComponent('缺货明细')
+    headers: {
+      'module': encodeURIComponent('缺货明细')
     }
   })
 }
- 
+
 // 导出缺货明细
 export const exportStockout = params => {
   const url = `/oos/detail/exportSalesOos`
@@ -256,8 +256,8 @@ export const exportStockout = params => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-          'module': encodeURIComponent('导出缺货明细')
+    headers: {
+      'module': encodeURIComponent('导出缺货明细')
     }
   })
 }
@@ -270,8 +270,43 @@ export const exportGroupStockout = params => {
     data: params,
     method: 'post',
     responseType: 'blob',
-    headers:{
-              'module': encodeURIComponent('导出分组缺货明细')
-        }
+    headers: {
+      'module': encodeURIComponent('导出分组缺货明细')
+    }
   })
-}
+}
+
+// 批量添加累计产品
+export const salesDetailInsertBatchBorrow = (params) => {
+  return axios({
+    url: '/sales/detail/insertBatchBorrow',
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('批量添加累计产品')
+    }
+  })
+}
+
+// 导出累计产品错误项
+export const exportBorrowError = params => {
+  delete params.priceType
+  return axios.request({
+    url: '/sales/detail/exportBorrowError',
+    data: params,
+    method: 'post',
+    responseType: 'blob',
+    headers: {
+      'module': encodeURIComponent('导出累计产品错误项')
+    }
+  })
+}
+
+// 批量导入累计产品 成功
+export const importBorrowTotalProduct = (params) => {
+  return axios({
+    url: '/sales/detail/importList',
+    method: 'post',
+    data: params
+  })
+}

+ 2 - 12
src/api/salesNew.js

@@ -494,17 +494,7 @@ export const salesDetailQueryBorrowPageList = (params) => {
     }
   })
 }
-// 批量添加累计产品
-export const salesDetailInsertBatchBorrow = (params) => {
-  return axios({
-    url: '/sales/detail/insertBatchBorrow',
-    data: params,
-    method: 'post',
-    headers: {
-      'module': encodeURIComponent('批量添加累计产品')
-    }
-  })
-}
+
 // 导入累计产品
 export const salesDetailImportBorrow = (params) => {
   return axios.request({
@@ -515,4 +505,4 @@ export const salesDetailImportBorrow = (params) => {
       'module': encodeURIComponent('导入累计产品')
     }
   })
-}
+}

+ 42 - 12
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -26,6 +26,12 @@
       :openModal="openGuideModal"
       @close="closeGuideModel"
       @ok="hanldeImportOk" />
+    <!-- 导入累计产品 -->
+    <importGuideTotalModal
+      ref="importGuideTotalModal"
+      :openModal="openGuideTotalModal"
+      @close="closeGuideTotalModel"
+      @ok="hanldeImportTotalOk" />
   </div>
 </template>
 
@@ -33,10 +39,11 @@
 import { commonMixin } from '@/utils/mixin'
 import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
 import ImportGuideModal from './importGuideModal.vue'
-import { salesPromoDetailCount, salesDisablePromo, salesEnablePromoPromo, salesBatchInsert } from '@/api/salesDetailNew'
+import importGuideTotalModal from './importGuideTotalModal.vue'
+import { salesPromoDetailCount, salesDisablePromo, salesEnablePromoPromo, salesBatchInsert, importBorrowTotalProduct } from '@/api/salesDetailNew'
 export default {
   mixins: [commonMixin],
-  components: { detailModal, ImportGuideModal },
+  components: { detailModal, ImportGuideModal, importGuideTotalModal },
   props: {
     activeList: {
       type: Array,
@@ -324,19 +331,22 @@ export default {
             // 导入产品按钮
             const importButton = []
             if (row && row.promotionRule && row.promotionRule.gateFlag === '1') {
-              importButton.push({ key: 'GATE', name: '门槛产品' })
+              importButton.push({ key: 'GATE', name: '导入门槛产品' })
             }
             if (row && row.promotionRule && row.promotionRule.promotionRuleType != 'PROMO_PROD') {
-              importButton.push({ key: 'REGULAR', name: '正价产品' })
+              importButton.push({ key: 'REGULAR', name: '导入正价产品' })
             }
             if (row && row.promotionRule && (row.promotionRule.regularPromotionSameFlag === '0' || row.promotionRule.scopeFlag === '0' || (row.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_MONEY' && row.promotionRule.scopeFlag === '1'))) {
-              importButton.push({ key: 'GIFT', name: '促销产品' })
+              importButton.push({ key: 'GIFT', name: '导入促销产品' })
             }
             if (row && row.promotionRule && row.promotionRule.promotionRuleType == 'PROMO_PROD') {
-              importButton.push({ key: 'DISCOUNT', name: '特价产品' })
+              importButton.push({ key: 'DISCOUNT', name: '导入特价产品' })
             }
-            if (row && row.promotion && row.promotion.borrowFlag == 1) {
-              importButton.push({ key: 'BORROW', name: '累计产品' })
+            if (row && row.promotion && row.promotion.borrowFlag == 1 && row.promotionRule.gateFlag === '1') {
+              importButton.push({ key: 'BORROW_GATE', name: '累计门槛产品' })
+            }
+            if (row && row.promotion && row.promotion.borrowFlag == 1 && row.promotionRule.promotionRuleType != 'PROMO_PROD') {
+              importButton.push({ key: 'BORROW_REGULAR', name: '累计正价产品' })
             }
             return (
               <div>
@@ -352,7 +362,7 @@ export default {
                   <a-menu slot="overlay" on-click={(e) => this.handleImportClick(e, row)} id={'salesEdit-menu-import-' + row.id}>
                     {importButton.map(item => {
                       return (
-                        <a-menu-item id={'salesEdit-menu-import-' + item.key + '-' + row.id} key={item.key}>{'导入' + item.name}</a-menu-item>
+                        <a-menu-item id={'salesEdit-menu-import-' + item.key + '-' + row.id} key={item.key}>{item.name}</a-menu-item>
                       )
                     })}
                   </a-menu>
@@ -390,7 +400,8 @@ export default {
       openDetailModal: false, // 规则详情弹框
       detailSn: null,
       disabledActiveOption: null,
-      openGuideModal: false //  导入产品引导
+      openGuideModal: false, //  导入产品引导
+      openGuideTotalModal: false// 导入累计产品引导
     }
   },
   methods: {
@@ -565,8 +576,9 @@ export default {
     // 导入产品
     handleImportClick (e, row) {
       // 导入累计产品
-      if (e.key == 'BORROW') {
-
+      if (e.key === 'BORROW_GATE' || e.key === 'BORROW_REGULAR') {
+        this.$refs.importGuideTotalModal.pageInit({ promoProductClz: e.key.split('_')[1], salesBillSn: this.salesBillSn, salesPromoSn: row.salesPromoSn }, row)
+        this.openGuideTotalModal = true
       } else {
         // 导入活动产品
         this.$refs.importGuideModal.pageInit({ promoProductClz: e.key, salesBillSn: this.salesBillSn, salesPromoSn: row.salesPromoSn }, row)
@@ -596,6 +608,24 @@ export default {
         }
       })
     },
+    hanldeImportTotalOk (list, row, type) {
+      const params = {
+        salesBillSn: this.salesBillSn,
+        salesBillDetailList: list
+      }
+      // 活动导入
+      if (row.salesPromoSn) {
+        params.salesPromoSn = row.salesPromoSn
+        // params.promoRuleSn = row.promoRuleSn
+        params.promoProductClz = promoProductClz
+      }
+      importBorrowTotalProduct(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('产品导入成功', 2.5)
+          this.$emit('refash', 'promo')
+        }
+      })
+    },
     // 添加产品
     addProduct (row, type) {
       this.$emit('openCpModal', type, row)

+ 179 - 0
src/views/salesManagement/salesQueryNew/comps/chooseImportTotalModal.vue

@@ -0,0 +1,179 @@
+<template>
+  <a-modal
+    centered
+    class="chooseImport-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="900">
+    <div class="chooseImport-con">
+      <!-- 可导入数据 -->
+      <p class="">可导入数据{{ loadData.length }}条</p>
+      <a-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :rowKey="(record) => record.productCode"
+        :columns="nowColumns"
+        :dataSource="loadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 分割线 -->
+      <a-divider />
+      <!-- 不可导入数据 -->
+      <p class="red">不可导入数据{{ unLoadData.length }}条</p>
+      <a-table
+        class="unTable"
+        ref="unTable"
+        size="small"
+        :rowKey="(record) => record.productCode"
+        :columns="nowUnColumns"
+        :dataSource="unLoadData"
+        :loading="loading"
+        :scroll="{ y: 200 }"
+        :pagination="false"
+        bordered>
+      </a-table>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="chooseImport-submit"
+          size="large"
+          :class="loadData.length==0?'button-grey':'button-primary'"
+          @click="handleSubmit"
+          style="padding: 0 40px;">确认导入</a-button>
+        <a-button
+          id="chooseImport-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 40px;margin-left: 15px;">取消</a-button>
+        <a-button
+          type="primary"
+          id="chooseImport-error"
+          size="large"
+          class="button-error"
+          @click="handleError"
+          style="padding: 0 40px;margin-left: 15px;">导出错误项</a-button>
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { exportBorrowError } from '@/api/salesDetailNew'
+export default {
+  name: 'SalesChooseImportModal',
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    },
+    paramsData: { // 参数
+      type: Object,
+      default: () => {
+        return {}
+      }
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      // 正常列
+      nowColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '46%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '46%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      loadData: [],
+      // 错误项列
+      nowUnColumns: [
+        { title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
+        { title: '销售单号', dataIndex: 'salesBillNo', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'productCode', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '备注', dataIndex: 'remarks', width: '32%', align: 'center', customRender: function (text) { return text || '--' } }
+      ],
+      unLoadData: [],
+      loading: false
+    }
+  },
+  methods: {
+    // 获取数据,并格式化
+    getData () {
+      const paramsData = JSON.parse(JSON.stringify(this.paramsData))
+      this.loadData = paramsData.rightList || [] // 可导入数据
+      this.unLoadData = paramsData.errorList || [] // 错误数据
+      // 格式化序号
+      this.loadData.map((item, index) => {
+        item.no = index + 1
+      })
+      this.unLoadData.map((item, index) => {
+        item.no = index + 1
+      })
+    },
+    // 确认导入
+    handleSubmit () {
+      if (this.loadData.length == 0) {
+        this.$message.warning('无可导入产品!')
+      } else {
+        this.$emit('ok', this.loadData)
+        this.isShow = false
+      }
+    },
+    // 导出
+    handleError () {
+      const _this = this
+      if (_this.unLoadData.length < 1) {
+        _this.$message.info('暂无可导出错误项~')
+        return
+      }
+      _this.spinning = true
+      hdExportExcel(exportBorrowError, _this.unLoadData, '销售导入产品错误项', function () {
+        _this.spinning = false
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.loadData = []
+        this.unLoadData = []
+      } else {
+        this.getData()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .chooseImport-modal{
+    .chooseImport-con{
+      .red{
+        color: #f30;
+      }
+      .btn-con{
+        text-align: center;
+        margin: 30px 0 20px;
+        .button-cancel,.button-error{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 1 - 0
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -73,6 +73,7 @@ export default {
     // row 产品信息, promoProductClz 促销产品类型
     insterProduct (row, promoProductClz) {
       this.$emit('addProduct', row, this.promoData, promoProductClz, this.cptype)
+      this.onClose()
     },
     // 初始化数据,
     // data 订单数据, promo 促销活动数据, type 组件类型

+ 20 - 11
src/views/salesManagement/salesQueryNew/comps/cumulativeProduct.vue

@@ -19,12 +19,12 @@
               <a-input id="cumulativeProductList-salesBillNo" v-model.trim="queryParam.salesBillNo" allowClear placeholder="请输入销售单号"/>
             </a-form-item>
           </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="产品名称">
-              <a-input id="cumulativeProductList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
-            </a-form-item>
-          </a-col>
           <template v-if="advanced">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品名称">
+                <a-input id="cumulativeProductList-name" v-model.trim="queryParam.productName" allowClear placeholder="请输入产品名称"/>
+              </a-form-item>
+            </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="原厂编码">
                 <a-input id="cumulativeProductList-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
@@ -53,7 +53,7 @@
       </a-form>
     </div>
     <!-- tab选项卡 -->
-    <a-tabs type="card" @change="changeTab">
+    <a-tabs type="card" @change="changeTab" size="small">
       <a-tab-pane v-for="item in tabList" :key="item.val" :tab="item.text"></a-tab-pane>
     </a-tabs>
     <div class="table-operator">
@@ -65,8 +65,8 @@
       class="sTable"
       ref="table"
       size="small"
-      :rowKey="(record) => record.borrowBillSn"
-      rowKeyName="borrowBillSn"
+      :rowKey="(record) => record.productSn"
+      rowKeyName="productSn"
       :columns="columns"
       :data="loadData"
       :row-selection="{ columnWidth: 40 }"
@@ -169,7 +169,7 @@ export default {
   },
   watch: {
     advanced (a, b) {
-      this.tableHeight = window.innerHeight - (a ? 375 : 330)
+      this.tableHeight = window.innerHeight - (a ? 413 : 368)
     }
   },
   methods: {
@@ -185,6 +185,9 @@ export default {
     changeTab (e) {
       this.promoProductClz = e
       this.resetSearchForm()
+      // 清空表格选中项
+      this.$refs.table.clearSelected()
+      // this.rowSelectionInfo = null
     },
     // 查询
     searchForm () {
@@ -222,7 +225,7 @@ export default {
       }
       this.tabList = tabList
       this.promoProductClz = tabList[0].val
-      this.tableHeight = window.innerHeight - 330
+      this.tableHeight = window.innerHeight - 368
       this.resetSearchForm()
     },
     // 刷新当前页面
@@ -238,7 +241,13 @@ export default {
         this.$message.warning('请先选择产品后再进行批量操作!')
         return
       }
-      this.$emit('add', this.rowSelectionInfo, this.promoProductClz)
+      const chooseDataList = this.rowSelectionInfo.selectedRows = this.rowSelectionInfo.selectedRows.map(item => {
+        item.borrowFlag = 1
+        item.salesBillSn = this.queryParam.salesBillSn
+        item.promotionFlag = this.promoProductClz
+        return item
+      })
+      this.$emit('add', chooseDataList, this.promoProductClz)
     },
     // 选择产品分类  change
     changeProductType (val, opt) {

+ 196 - 0
src/views/salesManagement/salesQueryNew/comps/importGuideTotalModal.vue

@@ -0,0 +1,196 @@
+<template>
+  <a-modal
+    centered
+    class="importGuide-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="导入产品"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="750">
+    <div class="importGuide-con">
+      <div class="explain-con">
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>1</span>准备导入
+          </div>
+          <ul>
+            <li>1) 导入的Excel文件中必填项为"销售单号"、"产品编码",需填写系统上已完结的销售单与该销售单内未参与促销活动、未被累计且符合当前促销规则的产品。</li>
+            <li>2) 错误项忽略不能导入,正确项可直接导入。</li>
+            <li>
+              <a :href="filePath" style="margin: 5px 0 0;display: block;">
+                <a-icon type="download" style="padding-right: 5px;" />下载导入模板
+              </a>
+            </li>
+          </ul>
+        </div>
+        <div class="explain-item">
+          <div class="explain-tit">
+            <span>2</span>上传数据文件
+          </div>
+          <p>目前支持的文件类型*.xls,*.xlsx.</p>
+          <div style="overflow: hidden;padding-left: 23px;">
+            <Upload
+              id="importGuide-attachList"
+              ref="importUpload"
+              :maxNums="1"
+              fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
+              uploadType="attach"
+              :action="attachAction"
+              :uploadParams="uploadParams"
+              upText="添加文件"
+              @change="changeImport"></Upload>
+          </div>
+        </div>
+      </div>
+      <!-- 按钮 -->
+      <div class="btn-con">
+        <a-button
+          type="primary"
+          id="importGuide-nextStep"
+          size="large"
+          class="button-primary"
+          @click="handlerNextStep"
+          style="padding: 0 60px;">下一步</a-button>
+        <a-button
+          id="importGuide-cancel"
+          size="large"
+          class="button-cancel"
+          @click="isShow=false"
+          style="padding: 0 60px;margin-left: 15px;">取消</a-button>
+      </div>
+    </div>
+    <!-- 导入 -->
+    <chooseImportTotalModal :openModal="openImportModal" :paramsData="paramsData" @close="handleClose" @ok="hanldeOk" />
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import chooseImportTotalModal from './chooseImportTotalModal.vue'
+import { Upload } from '@/components'
+export default {
+  name: 'SalesImportGuideModal',
+  mixins: [commonMixin],
+  components: { chooseImportTotalModal, Upload },
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      isShow: this.openModal, //  是否打开弹框
+      openImportModal: false, //  导入
+      attachAction: process.env.VUE_APP_API_BASE_URL + '/sales/detail/importBorrow', // 解析地址
+      paramsData: null, // 参数数据
+      uploadParams: { // 上传参数
+        salesBillSn: ''
+        // salesPromoSn: '',
+        // promoProductClz: ''
+      },
+      exportLoading: false,
+      filePath: location.protocol + '//' + location.host + '/templ/销售产品模板.xlsx', // 模板文件地址
+      curRowData: null
+    }
+  },
+  methods: {
+    pageInit (params, row) {
+      this.curRowData = row
+      this.uploadParams = params
+    },
+    // 下一步
+    handlerNextStep () {
+      if (this.paramsData) {
+        this.openImportModal = true
+      } else {
+        this.$message.warning('添加文件后再进行下一步操作!')
+      }
+    },
+    // 上传文件  change
+    changeImport (file) {
+      // console.log(file, JSON.parse(file))
+      if (file && JSON.parse(file).length > 0) {
+        this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.uploadParams)
+      } else {
+        this.paramsData = null
+      }
+    },
+    // 导入
+    hanldeOk (obj) {
+      if (obj && obj.length > 0) {
+        this.$emit('ok', obj, this.curRowData, this.uploadParams.promoProductClz)
+        this.isShow = false
+      }
+    },
+    // 关闭
+    handleClose () {
+      this.openImportModal = false
+      this.isShow = false
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.paramsData = null
+        this.$refs.importUpload.setFileList('')
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+  .importGuide-modal{
+    .importGuide-con{
+      .explain-con{
+        .explain-item{
+          margin-bottom: 10px;
+          .explain-tit{
+            font-weight: bold;
+            span{
+              display: inline-block;
+              width: 18px;
+              height: 18px;
+              line-height: 16px;
+              text-align: center;
+              margin-right: 5px;
+              border-radius: 50%;
+              border: 1px solid rgba(0, 0, 0, 0.3);
+            }
+          }
+          p{
+            margin: 8px 0;
+            padding-left: 23px;
+          }
+          ul{
+            list-style: none;
+            padding: 0;
+            padding-left: 23px;
+            margin: 0;
+            li{
+              line-height: 26px;
+            }
+          }
+        }
+        #importGuide-attachList{
+          width: 100%;
+        }
+      }
+      .btn-con{
+        margin: 10px 0 20px;
+        text-align: center;
+        .button-cancel{
+          font-size: 12px;
+        }
+      }
+    }
+  }
+</style>

+ 3 - 21
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -448,7 +448,7 @@ export default {
       })
     },
     // 累计产品到活动
-    accumulateProduct (row, promo, promoProductClz) {
+    accumulateProduct (chooseData, promo, promoProductClz) {
       // 防止多次添加产品
       if (this.isInster) { return }
       this.$message.loading('正在添加产品...', 1)
@@ -456,26 +456,8 @@ export default {
       this.spinning = true
       const params = {
         salesPromoSn: promo.salesPromoSn,
-        promoRuleSn: promo.promoRuleSn,
-        promoSn: promo.promoSn,
-        promoProductClz: promoProductClz,
-        packQty: row.productPackQty,
-        productSn: row.productSn,
-        showCost: row.lastStockCost,
-        price: row.productPrice,
-        origPrice: row.origPrice,
-        promotionGiftsAmount: 0,
-        usePromotionGiftsAmount: 0,
-        qty: row.salesNums,
-        salesBillSn: this.detailData.salesBillSn,
-        salesBillNo: this.detailData.salesBillNo,
-        purchaseBillSn: this.detailData.purchaseBillSn,
-        purchaseBillNo: this.detailData.purchaseBillNo,
-        priceLevel: row.priceLevel,
-        stockSn: row.stockSn,
-        promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
-        promotionFlag: 0, // 促销标记 正品传0,促销品传1
-        warehouseSn: row.warehouseSn
+        salesBillSn: promo.salesBillSn,
+        salesBillDetailList: chooseData
       }
       salesDetailInsertBatchBorrow(params).then(res => {
         if (res.status == 200) {