lilei 6 月之前
父节点
当前提交
c62375c0b0

+ 37 - 24
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="padding:10px;">
+  <div :style="{padding:type=='edit'?'10px':0}">
     <a-spin :spinning="spinning" tip="Loading...">
       <ve-table
         style="width:100%"
@@ -22,6 +22,7 @@
     <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="promoRuleSn" @close="closeDetailModal"></detailModal>
     <!-- 导入产品 -->
     <importGuideModal
+      v-if="type=='edit'"
       ref="importGuideModal"
       :openModal="openGuideModal"
       @close="closeGuideModel"
@@ -45,6 +46,10 @@ export default {
   mixins: [commonMixin],
   components: { detailModal, ImportGuideModal, totalProductDetailModal, normalProductDetailModal },
   props: {
+    type: {
+      type: String,
+      default: 'edit'
+    },
     activeList: {
       type: Array,
       default: () => []
@@ -71,15 +76,6 @@ export default {
     }
   },
   data () {
-    const _this = this
-    // 格式化数字金额单元格
-    const formatTd = (row, column, rowIndex, uniKey, fun) => {
-      if (row[column.field]) {
-        return (<div onClick={() => fun ? fun(row, uniKey) : false}><span class={fun ? 'table-link-btn' : ''}>{row[column.field]}</span><span style="font-size:10px;zoom:0.7;margin-left:3px;">{row[uniKey]}</span></div>)
-      } else {
-        return ''
-      }
-    }
     return {
       hasInit: false,
       spinning: false,
@@ -137,7 +133,27 @@ export default {
         }
       },
       // 表格列表
-      columns: [
+      tableData: [],
+      openDetailModal: false, // 规则详情弹框
+      promoRuleSn: null, // 销售单sn
+      disabledActiveOption: null, // 禁用规则选项
+      enableActiveOption: null, // 启用规则选项
+      openGuideModal: false, //  导入产品引导
+      buyGiftsInfo: null // 买赠产品弹窗详情信息
+    }
+  },
+  computed: {
+    columns () {
+      const _this = this
+      // 格式化数字金额单元格
+      const formatTd = (row, column, rowIndex, uniKey, fun) => {
+        if (row[column.field]) {
+          return (<div onClick={() => fun ? fun(row, uniKey) : false}><span class={fun ? 'table-link-btn' : ''}>{row[column.field]}</span><span style="font-size:10px;zoom:0.7;margin-left:3px;">{row[uniKey]}</span></div>)
+        } else {
+          return ''
+        }
+      }
+      const cols = [
         {
           field: '',
           key: '0',
@@ -369,8 +385,11 @@ export default {
         { field: 'totalCategory', key: '21', title: '款数', width: 50, align: 'center', fixed: 'right' },
         { field: 'totalQty', key: '22', title: '数量', width: 50, align: 'center', fixed: 'right' },
         { field: 'totalAmount', key: '23', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
-        { field: 'lossAmount', key: '24', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
-        {
+        { field: 'lossAmount', key: '24', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } }
+      ]
+      // 编辑页面
+      if (this.type == 'edit') {
+        cols.push({
           field: '',
           key: '25',
           title: '状态',
@@ -391,8 +410,8 @@ export default {
               </div>
             )
           }
-        },
-        {
+        })
+        cols.push({
           field: '',
           key: '26',
           title: '操作',
@@ -458,15 +477,9 @@ export default {
               </div>
             )
           }
-        }
-      ],
-      tableData: [],
-      openDetailModal: false, // 规则详情弹框
-      promoRuleSn: null, // 销售单sn
-      disabledActiveOption: null, // 禁用规则选项
-      enableActiveOption: null, // 启用规则选项
-      openGuideModal: false, //  导入产品引导
-      buyGiftsInfo: null // 买赠产品弹窗详情信息
+        })
+      }
+      return cols
     }
   },
   methods: {

+ 29 - 132
src/views/salesManagement/salesQueryNew/comps/detailProductList.vue

@@ -1,23 +1,22 @@
 <template>
   <!-- 已选配件列表 -->
   <a-spin :spinning="spinning" tip="Loading...">
-    <ve-table
-      border-y
-      v-show="!showEmpty"
-      :scroll-width="0"
-      :max-height="tableHeight"
-      :show-header="showTableHead"
-      :row-style-option="{clickHighlight: true}"
-      :cellSelectionOption="{enable: false}"
-      :virtual-scroll-option="{enable: true}"
-      :columns="columns"
-      :table-data="dataSource"
-      row-key-field-name="id"
-      :cell-style-option="cellStyleOption"
-      :cell-span-option="cellSpanOption"
-      :column-width-resize-option="columnWidthResizeOption"
-    />
-    <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
+    <div style="margin: 10px 0;">
+      <ve-table
+        border-y
+        :scroll-width="0"
+        :max-height="showEmpty?0:tableHeight"
+        :show-header="showTableHead"
+        :row-style-option="{clickHighlight: true}"
+        :cellSelectionOption="{enable: false}"
+        :virtual-scroll-option="{enable: true}"
+        :columns="columns"
+        :table-data="dataSource"
+        row-key-field-name="id"
+        :column-width-resize-option="columnWidthResizeOption"
+      />
+      <div v-show="showEmpty" class="empty-data"><a-empty description="暂无产品" :image="simpleImage"/></div>
+    </div>
     <!-- 活动规则详情 -->
     <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
   </a-spin>
@@ -27,8 +26,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { Empty } from 'ant-design-vue'
 import detailModal from '@/views/promotionRulesManagement/dealerPromotions/detailModal.vue'
-import { salesPromoQueryList } from '@/api/salesNew'
-import { salesDetailAllList, salesPromoDetailCount, salesDetaiCount } from '@/api/salesDetailNew'
+import { salesDetailAllList, salesDetailExtPromoList, salesDetaiCount } from '@/api/salesDetailNew'
 export default {
   name: 'DetailProductList',
   mixins: [commonMixin],
@@ -39,6 +37,11 @@ export default {
       type: Object,
       default: function () { return null }
     },
+    // 正常 or 活动 产品列表
+    type: {
+      type: String,
+      default: 'normal'
+    },
     // 活动规则详情
     promo: {
       type: Object,
@@ -90,17 +93,8 @@ export default {
       spinning: false,
       openDetailModal: false, // 活动规则详情弹框
       detailSn: null, // 活动规则详情sn
-      activeList: [], // 活动列表
       dataSource: [], // 列表原始数据
       tableHeight: this.maxHeight, // 表格高度
-      // 自定义单元格样式
-      cellStyleOption: {
-        bodyCellClass: ({ row, column, rowIndex }) => {
-          if (row.id.indexOf('promo-') >= 0 && column.field === 'no') {
-            return 'table-body-cell-no'
-          }
-        }
-      },
       // 表格列可拖曳
       columnWidthResizeOption: {
         // default false
@@ -108,10 +102,6 @@ export default {
         // column resize min width
         minWidth: 50
       },
-      // 自定义单元格内容
-      cellSpanOption: {
-        bodyCellSpan: this.bodyCellSpan
-      },
       isCityPrice: false, // 是否显示市级价
       outStockStr: '', // 产品库存不足提示信息
       showEmpty: false, // 是否显示空数据图片
@@ -207,54 +197,40 @@ export default {
         { title: '出库仓库', field: 'warehouseName', key: 'e', width: 100, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } }
       ]
       // 计算可合并单元格数
-      this.colspanNums = this.showConvertPromoGifts ? 6 : 5
       if (this.$hasPermissions(this.authCode + '_costPrice')) { //  成本价权限
-        this.colspanNums = this.colspanNums + 1
         arr.push({ title: '成本价', field: 'showCost', width: 80, key: 'f', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
       }
-      this.colspanNums = this.colspanNums + 2
       arr = arr.concat([
         { title: '单位', field: 'productOrigUnit', key: 'g', width: 80, align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row[column.field] || '--' } },
         { title: '销售数量', field: 'qty', width: 80, key: 'h', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
       ])
 
       if (this.$hasPermissions(this.authCode + '_provincePrice')) {
-        this.colspanNums = this.colspanNums + 1
         arr.push({ title: '省级价', field: 'provincePrice', width: 80, key: 'i', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
       }
       // 是否勾选市级价格
       if (this.isCityPrice) {
-        this.colspanNums = this.colspanNums + 1
         arr.push({ title: '市级价', field: 'cityPrice', width: 80, key: 'j', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return priceFormat(row[column.field]) } })
         if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-          this.colspanNums = this.colspanNums + 1
           arr.push({ title: '销售价', field: 'price', width: 100, key: 'k', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row, row[column.field], h) } })
         }
       } else {
         if (this.$hasPermissions(this.authCode + '_salesPrice')) { //  售价权限
-          this.colspanNums = this.colspanNums + 1
           arr.push({ title: '销售价', field: 'price', width: 100, key: 'l', align: 'right', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return discountPriceFormat(row, row[column.field], h) } })
         }
       }
       //  审核,需用到库存
       if (this.showStock) {
-        this.colspanNums = this.colspanNums + 1
         arr.push({ title: '库存', field: 'stockQty', width: 80, key: 'm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         if (this.showStockCol) {
-          this.colspanNums = this.colspanNums + 1
           arr.push({ title: '第三方库存', field: 'thirdStockQty', width: 80, key: 'mm', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
         }
       }
-      this.colspanNums = this.colspanNums + 3
       arr = arr.concat([
         { title: '待下推数', field: 'unpushedQty', width: 80, key: 'o', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } },
         { title: '已下推数', field: 'pushedQty', width: 80, key: 'p', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } }
       ])
 
-      // 如果有转采购额
-      if (this.showConvertPromoGifts) {
-        arr.push({ title: '转采购额数量', field: 'convertPromoGiftsQty', width: 100, key: 'z', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return row.convertPromoGiftsFlag ? numsFormat(row[column.field]) : '--' } })
-      }
       arr.push({ title: '已取消数', field: 'cancelQty', width: 80, key: 'q', align: 'center', operationColumn: false, renderBodyCell: ({ row, column, rowIndex }, h) => { return numsFormat(row[column.field]) } })
       return arr
     },
@@ -262,10 +238,6 @@ export default {
     hasConvertPromoGifts () {
       return this.detailData && this.detailData.totalConvertPromoGiftsQty
     },
-    // 是否显示可转采购额
-    showConvertPromoGifts () {
-      return this.activeList && this.activeList.filter(item => item.enabledFlag == 1).find(item => item.promotionRule && item.promotionRule.convertExpenseFlag == 1 && item.promotionRule.promotionRuleType == 'BUY_PROD_GIVE_PROD')
-    },
     // 是否显示库存列
     showStock () {
       return this.detailData && (this.detailData.billStatus == 'WAIT_AUDIT' || this.detailData.billStatus == 'HQ_CHANGE') && this.$hasPermissions('B_salesAudit')
@@ -283,22 +255,6 @@ export default {
       this.detailSn = null
       this.openDetailModal = false
     },
-    // 合并活动分类单元格
-    bodyCellSpan ({ row, column, rowIndex }) {
-      if (row.id.indexOf('promo-') >= 0) {
-        if (column.field == 'no') {
-          return {
-            rowspan: 1,
-            colspan: this.colspanNums
-          }
-        } else {
-          return {
-            rowspan: 0,
-            colspan: 0
-          }
-        }
-      }
-    },
     // 查看活动详情
     showDesc (row) {
       this.detailSn = row.promoRuleSn
@@ -306,14 +262,7 @@ export default {
     },
     // 获取销售单参与的活动列表
     pageInit () {
-      salesPromoQueryList({ salesBillSn: this.salesBillSn }).then(res => {
-        if (res.status == 200) {
-          this.activeList = res.data || []
-        }
-        this.$nextTick(() => {
-          this.searchTable()
-        })
-      })
+      this.searchTable()
     },
     // 显示第三方库存
     showThreeStock () {
@@ -331,66 +280,14 @@ export default {
         warehouseSn: this.warehouseSn,
         promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
       }
-      // 参与活动数据
-      const active = this.activeList.filter(item => item.enabledFlag == 1)
-
-      // 是否有活动产品
-      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
-
-      // 有促销活动产品时,循环获取每个活动的数据
-      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)).toFixed(2)
-            // 采购额超出
-            acTotal.cgeccAmount = (Number(acTotal.totalUsePromoGiftsAmount || 0) - Number(acTotal.totalPromoGiftsAmount || 0)).toFixed(2)
-          }
-          // 有数据时才调用接口,避免做无用的调用
-          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) || []
-          }
-        }
-      }
+      // 查询正常产品明细列表
+      const normalList = this.type == 'normal' ? await salesDetailAllList(params).then(res => res.data) : []
+      const norTotal = this.type == 'normal' ? await salesDetaiCount(params).then(res => res.data) : null
+      // 查询活动产品明细列表
+      const activeList = this.type == 'active' ? await salesDetailExtPromoList({ salesPromoSnSet: [], ...params }).then(res => res.data) : []
       // 赋值
-      this.dataSource = listData
+      this.dataSource = this.type == 'normal' ? normalList : activeList
 
       // 格式化数据
       let f = 0

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

@@ -164,7 +164,6 @@
           :loading="delLoading"
           class="button-info"
           :id="'salesEdit-addPromo-'+record.id"
-          v-if="hasActive"
           @click="handleAddPromo(record)"
         >参与促销</a-button>
         <a-button

+ 72 - 17
src/views/salesManagement/salesQueryNew/detail.vue

@@ -139,7 +139,7 @@
             </div>
           </div>
         </div>
-        <!-- 产品列表 -->
+        <!-- 正常产品列表 -->
         <div>
           <detailProductList
             ref="productList"
@@ -148,11 +148,35 @@
             :promoFlag="promoFlag"
             :salesBillSn="$route.params.sn || bizSn"
             :authCode="authCode"
-            :maxHeight="pageHeight"
             :showCityPrice="isCityPrice">
           </detailProductList>
         </div>
       </a-card>
+      <!-- 活动产品列表 -->
+      <a-card
+        size="small"
+        :bordered="false"
+        title="活动产品"
+        class="salesEdit-cont"
+      >
+        <activeStatisticsList
+          ref="activeTjList"
+          type="view"
+          :activeList="activeList"
+          :warehouseSn="warehouseSn"
+          :salesBillSn="$route.params.sn || bizSn"
+        ></activeStatisticsList>
+        <detailProductList
+          ref="productActiveList"
+          type="active"
+          :detailData="detailData"
+          :warehouseSn="warehouseSn"
+          :promoFlag="promoFlag"
+          :salesBillSn="$route.params.sn || bizSn"
+          :authCode="authCode"
+          :showCityPrice="isCityPrice">
+        </detailProductList>
+      </a-card>
     </a-spin>
     <div class="affix-cont" :style="{padding:hideFooter?0:'7px 0 4px'}">
       <a-button
@@ -244,15 +268,29 @@ import dsModal from '@/views/salesManagement/waitDispatchNew/dsModal.vue'
 import stockOutDetail from './stockOutDetailModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
 import detailProductList from './comps/detailProductList.vue'
+import activeStatisticsList from './comps/activeStatisticsList.vue'
 import tipModal from './tipModal.vue'
 import vaildPriceModal from './vaildPriceModal.vue'
 // 接口
-import { salesDetailBySn, salesDetailPrint, salesDetailExcel, salesDetailTypeExcel, salesWriteAuditPass, salesWriteUpAuditPass, salesWriteAuditReject, salesWriteAuditPush, getThirdStockQty, salesPromoValidaAudit, changeBillCheckUpdatePrice, changeBillCheck } from '@/api/salesNew'
+import {
+  salesPromoQueryStatisticsList,
+  salesDetailBySn,
+  salesDetailPrint,
+  salesDetailExcel,
+  salesDetailTypeExcel,
+  salesWriteAuditPass,
+  salesWriteUpAuditPass,
+  salesWriteAuditReject,
+  salesWriteAuditPush,
+  getThirdStockQty,
+  salesPromoValidaAudit,
+  changeBillCheckUpdatePrice,
+  changeBillCheck } from '@/api/salesNew'
 
 export default {
   name: 'SalesDetailNew',
   mixins: [commonMixin],
-  components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList, tipModal, vaildPriceModal },
+  components: { VSelect, printModal, auditModal, dsModal, stockOutDetail, chooseWarehouse, detailProductList, activeStatisticsList, tipModal, vaildPriceModal },
   props: {
     bizSn: { //  有值则为弹框,无值则为页面
       type: [Number, String],
@@ -265,6 +303,7 @@ export default {
       disabled: false,
       showDsModal: false, // 一键审核弹框
       showStockOut: false, // 缺货明细弹框
+      activeList: [], // 参与活动列表
       authCode: '', // 权限码
       hasData: false, // 是否有数据
       showDetail: false, // 基础信息是否显示
@@ -369,7 +408,7 @@ export default {
     // 取消时,跳转编辑页面
     closeTipModal () {
       this.openTipModal = false
-      this.$router.push({ name: 'salesNewEdit', params: { sn: this.$route.params.sn } })
+      this.$router.push({ name: 'salesNewEdit', params: { sn: this.$route.params.sn || this.bizSn } })
     },
     // 价格低于成本校验提示,继续审核
     vaildPriceOk (type) {
@@ -397,6 +436,17 @@ export default {
         })
       }
     },
+    // 查询第三方库存
+    getThreeStock () {
+      this.spinning = true
+      getThirdStockQty({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
+        if (res.status == 200) {
+          this.$refs.productList.showThreeStock()
+          this.resetSearchForm()
+        }
+        this.spinning = false
+      })
+    },
     //  重置
     resetSearchForm () {
       this.warehouseSn = undefined
@@ -408,17 +458,7 @@ export default {
     // 查询数据
     searchTable () {
       this.$refs.productList.searchTable()
-    },
-    // 查询第三方库存
-    getThreeStock () {
-      this.spinning = true
-      getThirdStockQty({ salesBillSn: this.bizSn || this.$route.params.sn }).then(res => {
-        if (res.status == 200) {
-          this.$refs.productList.showThreeStock()
-          this.resetSearchForm()
-        }
-        this.spinning = false
-      })
+      this.$refs.productActiveList.searchTable()
     },
     // 详情
     getDetail () {
@@ -427,9 +467,24 @@ export default {
           this.detailData = res.data || null
           this.detailData.totalDiscountAmount = Number(this.detailData.totalOrigAmount || 0) - Number(this.detailData.totalAmount || 0)
         }
-        this.$refs.productList.pageInit()
+        this.getActiveList()
       })
     },
+    // 获取销售单参与的活动列表
+    async getActiveList () {
+      // 已参与活动列表
+      const list = await salesPromoQueryStatisticsList({ salesBillSn: this.$route.params.sn || this.bizSn }).then(res => res.data || [])
+      this.activeList = list.filter(item => item.promotion && item.promotionRule)
+      // 触发活动统计查询变量
+      this.$nextTick(() => {
+        this.$refs.activeTjList.hasInit = false
+        // 刷新活动统计
+        this.$refs.activeTjList.getDataList()
+      })
+      setTimeout(() => {
+        this.resetSearchForm()
+      }, 500)
+    },
     // 打开缺货明细弹框
     openStockOut () {
       if (this.$refs.productList.outStockStr != '') {

+ 10 - 10
src/views/salesManagement/salesQueryNew/edit.vue

@@ -281,7 +281,7 @@ export default {
           // 刷新正常活动产品列表
           this.$refs.productNormalList.searchThreeStockOk()
           // 刷新所有活动产品列表
-          this.$refs.productActiveList.searchThreeStockOk()
+          if (this.activeList.length) this.$refs.productActiveList.searchThreeStockOk()
         }
         this.spinning = false
       })
@@ -293,13 +293,13 @@ export default {
       this.activeList = list.filter(item => item.promotion && item.promotionRule)
       // 触发活动统计查询变量
       this.$nextTick(() => {
-        this.$refs.activeTjList.hasInit = false
+        if (this.activeList.length) this.$refs.activeTjList.hasInit = false
       })
       setTimeout(() => {
         // 刷新正常产品列表
         this.$refs.productNormalList.resetSearchForm()
         // 刷新活动产品列表
-        this.$refs.productActiveList.resetSearchForm()
+        if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
       }, 500)
     },
     // 获取是否有新活动,
@@ -364,12 +364,12 @@ export default {
         this.$refs.chooseProduct.onClose()
       } else if (type == 'normal') { // 如果是正常产品
         // 刷新活动产品列表
-        this.$refs.productActiveList.resetSearchForm()
+        if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
       } else {
         // 刷新正常产品列表
         this.$refs.productNormalList.resetSearchForm()
         // 刷新活动产品列表
-        this.$refs.productActiveList.resetSearchForm()
+        if (this.activeList.length) this.$refs.productActiveList.resetSearchForm()
       }
       // 重新获取详情信息
       this.getOrderDetail(false)
@@ -382,10 +382,10 @@ export default {
       } else {
         // 活动产品对象
         if (cptype == 1) {
-          this.$refs.productActiveList.saveNewProduct(row, promo, promoProductClz)
+          if (this.activeList.length) this.$refs.productActiveList.saveNewProduct(row, promo, promoProductClz)
         }
         if (cptype == 2) {
-          this.$refs.productActiveList.accumulateProduct(row, promo, promoProductClz)
+          if (this.activeList.length) this.$refs.productActiveList.accumulateProduct(row, promo, promoProductClz)
         }
       }
     },
@@ -395,16 +395,16 @@ export default {
         if (res.status == 200) {
           if (type == 1) {
             // 刷新活动产品
-            this.$refs.productActiveList.upAcitveSuccess()
+            if (this.activeList.length) this.$refs.productActiveList.upAcitveSuccess()
             // 刷新活动统计
-            this.$refs.activeTjList.getDataList()
+            if (this.activeList.length) this.$refs.activeTjList.getDataList()
             // 刷新详情和正常产品列表
             this.refashTableData('promo')
           } else {
             // 刷新正常活动
             this.$refs.productNormalList.addAcitveSuccess()
             // 刷新活动统计
-            this.$refs.activeTjList.getDataList()
+            if (this.activeList.length) this.$refs.activeTjList.getDataList()
             // 刷新详情和活动产品列表
             this.refashTableData('normal')
           }