Browse Source

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

chenrui 7 months ago
parent
commit
f63592b475

+ 3 - 3
src/views/easyPassManagement/homepageCarouselImg/detailModal.vue

@@ -38,10 +38,10 @@
             <img
               :src="form.imageUrl"
               alt="图片走丢了"
-              width="80"
-              height="80"
+              width="750px"
+              height="300px"
               style="margin-right:10px;object-fit: cover;"/>
-            <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
+            <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(750px)*高(300px)</div>
           </a-form-model-item>
           <a-form-model-item label="内容类型" prop="contentType">
             {{ form.contentType==='IMAGE_CONTENT'?'图文展示':form.contentType==='VIDEO'?'视频展示':form.contentType==='LINK'?'跳转链接':'促销活动' }}

+ 1 - 1
src/views/easyPassManagement/promotionalActivities/addPromotionModal.vue

@@ -100,7 +100,7 @@
                   :maxNums="1"
                   @change="changeImage"
                   listType="picture-card"></Upload>
-                <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(420px)*高(230px)</div>
+                <div class="upload-desc">说明:单张大小小于10Mb;建议尺寸:宽(750px)*高(300px)</div>
               </a-form-model-item>
             </a-col>
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">

+ 2 - 0
src/views/promotionRulesManagement/dealerPromotions/detailModal.vue

@@ -376,7 +376,9 @@ export default {
     },
     // 获取列表详情
     getDetail () {
+      this.spinning = true
       getRuleDetail({ sn: this.itemSn }).then(res => {
+        this.spinning = false
         if (res.status == 200) {
           const resultObj = res.data
           if (resultObj.gateFlag == '1') {

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

@@ -1,26 +1,42 @@
 <template>
   <div style="padding:10px;">
-    <ve-table
-      style="width:100%"
-      :max-height="300"
-      :scroll-width="0"
-      border-y
-      border-x
-      border-around
-      row-key-field-name="id"
-      :checkbox-option="checkboxOption"
-      :column-width-resize-option="columnWidthResizeOption"
-      :row-style-option="{clickHighlight: true}"
-      :cellSelectionOption="{enable: false}"
-      :virtual-scroll-option="{enable: false}"
-      :columns="columns"
-      :table-data="tableData" />
+    <a-spin :spinning="spinning" tip="Loading...">
+      <ve-table
+        style="width:100%"
+        :max-height="300"
+        :scroll-width="0"
+        border-y
+        border-x
+        border-around
+        row-key-field-name="id"
+        :checkbox-option="checkboxOption"
+        :column-width-resize-option="columnWidthResizeOption"
+        :cell-style-option="cellStyleOption"
+        :row-style-option="{clickHighlight: true}"
+        :cellSelectionOption="{enable: false}"
+        :virtual-scroll-option="{enable: false}"
+        :columns="columns"
+        :table-data="tableData" />
+    </a-spin>
+    <!-- 活动规则详情 -->
+    <detailModal :openModal="openDetailModal" pageType="salesPage" :itemSn="detailSn" @close="closeDetailModal"></detailModal>
+    <!-- 导入产品 -->
+    <importGuideModal
+      ref="importGuideModal"
+      :openModal="openGuideModal"
+      @close="closeGuideModel"
+      @ok="hanldeImportOk" />
   </div>
 </template>
 
 <script>
-import { salesPromoDetailCount } from '@/api/salesDetailNew'
+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'
 export default {
+  mixins: [commonMixin],
+  components: { detailModal, ImportGuideModal },
   props: {
     activeList: {
       type: Array,
@@ -40,13 +56,18 @@ export default {
   watch: {
     activeList: {
       handler (val) {
-        this.getDataList()
+        if (!this.hasInit) {
+          this.getDataList()
+        }
       },
       immediate: true
     }
   },
   data () {
+    const _this = this
     return {
+      hasInit: false,
+      spinning: false,
       columnWidthResizeOption: {
         // default false
         enable: true,
@@ -63,6 +84,28 @@ export default {
           console.log(isSelected, selectedRowKeys)
         }
       },
+      // 单元格样式
+      cellStyleOption: {
+        headerCellClass: ({ column, rowIndex }) => {
+          if (column.field == 'col2' || column.field == 'col3' || column.field == 'col4') {
+            return 'table-header-cell-blue'
+          }
+          if (column.field == 'col6' || column.field == 'col7' || column.field == 'col8' || column.field == 'col9') {
+            return 'table-header-cell-red'
+          }
+          if (column.field == 'col11' || column.field == 'col12' || column.field == 'col13') {
+            return 'table-header-cell-green'
+          }
+          if (column.field == 'col14' || column.field == 'col15' || column.field == 'col16' || column.field == 'col17') {
+            return 'table-header-cell-org'
+          }
+          if (column.field == 'col18' || column.field == 'col19' || column.field == 'col20') {
+            return 'table-header-cell-zs'
+          }
+        },
+        bodyCellClass: ({ row, column, rowIndex }) => {
+        }
+      },
       columns: [
         {
           field: '',
@@ -84,8 +127,8 @@ export default {
             return ++rowIndex
           }
         },
-        { field: 'promotionRuleType', key: 'ruletype', width: 100, title: '活动类型', align: 'center', fixed: 'left' },
-        { field: 'promotionRuleDesc', key: 'ruledesc', width: 100, title: '规则简称', align: 'center', fixed: 'left' },
+        { field: 'promotionRuleType', key: 'ruletype', width: 100, title: '活动类型', align: 'center', fixed: 'left', ellipsis: { showTitle: true } },
+        { field: 'promotionRuleDesc', key: 'ruledesc', width: 100, title: '规则简称', align: 'center', fixed: 'left', renderBodyCell: ({ row, column, rowIndex }, h) => { return (<div class="table-link-text" onClick={() => _this.showDesc(row)}>{row[column.field]}</div>) } },
         {
           title: '门槛产品(数量/金额)',
           children: [
@@ -104,7 +147,7 @@ export default {
               align: 'center'
             },
             {
-              field: 'col5',
+              field: 'col4',
               key: 'e',
               title: '差额',
               width: 50,
@@ -137,7 +180,7 @@ export default {
               align: 'center'
             },
             {
-              field: 'col10',
+              field: 'col9',
               key: 'l',
               title: '差额',
               width: 50,
@@ -175,28 +218,28 @@ export default {
           title: '采购额(金额)',
           children: [
             {
-              field: 'col14',
+              field: 'totalUsePromoGiftsAmount',
               key: 'm',
               title: '额度',
               width: 50,
               align: 'center'
             },
             {
-              field: 'col15',
+              field: 'totalPromoGiftsAmount',
               key: 'n',
               title: '已选',
               width: 50,
               align: 'center'
             },
             {
-              field: 'col16',
+              field: 'cgejyAmount',
               key: 'kq',
               title: '结余',
               width: 50,
               align: 'center'
             },
             {
-              field: 'col17',
+              field: 'cgeccAmount',
               key: 'jw',
               title: '超支',
               width: 50,
@@ -232,8 +275,8 @@ export default {
         },
         { field: 'totalCategory', key: 'ks', title: '款数', width: 50, align: 'center', fixed: 'right' },
         { field: 'totalQty', key: 'dsl', title: '数量', width: 50, align: 'center', fixed: 'right' },
-        { field: 'totalAmount', key: 'dje', title: '总金额', width: 60, align: 'center', fixed: 'right' },
-        { field: 'lossAmount', key: 'dyhje', title: '优惠金额', width: 60, align: 'center', fixed: 'right' },
+        { field: 'totalAmount', key: 'dje', title: '总金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
+        { field: 'lossAmount', key: 'dyhje', title: '优惠金额', width: 60, align: 'center', fixed: 'right', renderBodyCell: ({ row, column, rowIndex }, h) => { return this.toThousands(row[column.field]) } },
         {
           field: '',
           key: 'action',
@@ -296,11 +339,16 @@ export default {
           }
         }
       ],
-      tableData: []
+      tableData: [],
+      openDetailModal: false, // 规则详情弹框
+      detailSn: null,
+      disabledActiveOption: null,
+      openGuideModal: false //  导入产品引导
     }
   },
   methods: {
     async getDataList () {
+      this.hasInit = true
       for (let i = 0; i < this.activeList.length; i++) {
         const item = this.activeList[i]
         // 参数
@@ -310,7 +358,7 @@ export default {
           promotionFlag: undefined
         }
         let acTotal = {}
-        // 参与活动数据获取统计信息
+        // 启用的活动数据获取统计信息
         if (item.enabledFlag == 1) {
           // 参数
           const activeParams = {
@@ -321,36 +369,228 @@ export default {
           }
           // 获取活动产品统计
           acTotal = await salesPromoDetailCount(activeParams).then(res => res.data)
+          console.log(acTotal, 'acTotal')
           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)
           }
+        } else {
+          // 禁用活动不显示
+          delete item.totalPromoGiftsAmount
+          delete item.totalUsePromoGiftsAmount
         }
         this.tableData.push({
           ...item,
           promotionRuleType: item.promotionRule.promotionRuleTypeDictValue,
           promotionRuleDesc: item.promotionRule.description,
-          ...acTotal
+          ...acTotal,
+          countData: acTotal
         })
       }
     },
-    // 禁用启用
-    enableRow (row) {
-
+    // 禁用启用活动规则
+    // 启用规则
+    enabledActive (item) {
+      const _this = this
+      this.spinning = true
+      salesEnablePromoPromo({
+        salesBillSn: _this.salesBillSn,
+        salesPromoSn: item.salesPromoSn
+      }).then(res => {
+        if (res.status == 200) {
+          item.disabled = false
+          _this.activeList.splice()
+          // 刷新产品表格
+          _this.$emit('refashProduct')
+          _this.$message.success('启用成功')
+        }
+        _this.spinning = false
+      })
+    },
+    // 禁用规则
+    disabledActive (e, item) {
+      const _this = this
+      _this.spinning = true
+      salesDisablePromo({
+        salesBillSn: _this.salesBillSn,
+        salesPromoSn: item.salesPromoSn,
+        promoRuleSn: item.promoRuleSn,
+        salesDisableType: _this.disabledActiveOption
+      }).then(res => {
+        if (res.status == 200) {
+          item.disabled = true
+          _this.activeList.splice()
+          // 刷新产品表格
+          _this.$emit('refashProduct')
+          _this.disabledActiveOption = null
+          _this.$message.success('禁用成功')
+        }
+        _this.spinning = false
+      })
+    },
+    enableRow (item) {
+      const _this = this
+      // 禁用的直接启用
+      if (item.disabled) {
+        this.enabledActive(item)
+        return
+      }
+      // 如果没有活动产品,直接禁用无需弹框提示
+      // const table = _this.$refs['productList-' + item.promoRuleSn][0]
+      // if (!table.countData || table.countData && !table.countData.totalQty) {
+      //   _this.disabledActiveOption = 'DELETE'
+      //   _this.disabledActive(item)
+      //   return
+      // }
+      // 弹框提示禁用方式
+      this.$confirm({
+        title: item.promotion.description + '-' + item.promotionRule.description + ',确定禁用规则?',
+        centered: true,
+        class: 'confirm-center',
+        content: <div>
+          <div style="padding:10px 0;text-align:center;">禁用规则后,将无法享受该活动规则优惠</div>
+          <div style="padding:0 0 10px 0;text-align:center;">
+            <aRadioGroup onChange={_this.changeDaOpt}>
+              <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="DELETE">
+                删除规则中相关产品
+              </aRadio>
+              <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="REMOVE">
+                移出规则中相关产品
+              </aRadio>
+            </aRadioGroup>
+          </div>
+        </div>,
+        onOk () {
+          if (_this.disabledActiveOption) {
+            _this.disabledActive(item)
+          } else {
+            _this.$message.info('请选择禁用方式!')
+            return true
+          }
+        },
+        onCancel () {
+          _this.disabledActiveOption = null
+        }
+      })
+    },
+    // 选择禁用活动选项
+    changeDaOpt (e) {
+      this.disabledActiveOption = e.target.value
     },
     // 导入产品
-    handleImportClick (key, row) {
-
+    handleImportClick (e, row) {
+      this.$refs.importGuideModal.pageInit({ promoProductClz: e.key, salesBillSn: this.salesBillSn, salesPromoSn: row.salesPromoSn }, row)
+      this.openGuideModal = true
+    },
+    // 关闭导入弹框
+    closeGuideModel () {
+      this.openGuideModal = false
+    },
+    // 批量导入产品
+    hanldeImportOk (salesBillDetailList, row, promoProductClz) {
+      const params = {
+        salesBillSn: this.salesBillSn,
+        salesBillDetailList: salesBillDetailList
+      }
+      // 活动导入
+      if (row.salesPromoSn) {
+        params.salesPromoSn = row.salesPromoSn
+        params.promoRuleSn = row.promoRuleSn
+        params.promoProductClz = promoProductClz
+      }
+      salesBatchInsert(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('产品导入成功', 2.5)
+          this.$emit('insterOk', 'promo')
+        }
+      })
     },
     // 添加产品
     addProduct (row) {
-
+      this.$emit('openCpModal', 1, row)
+    },
+    // 保存添加的产品到销售列表
+    saveNewProduct (row, promotionFlag, promoProductClz) {
+      // 防止多次添加产品
+      if (this.isInster) { return }
+      this.$message.loading('正在添加产品...', 1)
+      this.isInster = true
+      this.spinning = true
+      const params = {
+        salesPromoSn: this.promo.salesPromoSn,
+        promoRuleSn: this.promo.promoRuleSn,
+        promoSn: this.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: promotionFlag, // 促销标记 正品传0,促销品传1
+        warehouseSn: row.warehouseSn
+      }
+      salesDetailInsert(params).then(res => {
+        if (res.status == 200) {
+          this.$message.success('产品添加成功', 2.5)
+          this.resetSearchForm(true)
+          this.$emit('insterOk', 'promo')
+        }
+        this.spinning = false
+        this.isInster = false
+      }).catch(err => {
+        this.isInster = false
+        this.spinning = false
+      })
+    },
+    // 查看活动详情
+    showDesc (row) {
+      if (row.promoRuleSn) {
+        this.detailSn = row.promoRuleSn
+        this.openDetailModal = true
+      }
+    },
+    // 关闭详情弹窗
+    closeDetailModal () {
+      this.detailSn = null
+      this.openDetailModal = false
     }
   }
 }
 </script>
 
-<style>
+<style lang="less">
+  .table-header-cell-blue {
+    background: #c9fbff !important;
+  }
+  .table-header-cell-red {
+    background: #ffdccb !important;
+  }
+  .table-header-cell-green {
+    background: #deffec !important;
+  }
+  .table-header-cell-zs {
+    background: #fff2ff !important;
+  }
+  .table-header-cell-org {
+    background: #fff3c2 !important;
+  }
+  .table-link-text{
+    color: #409EFF;
+    cursor: pointer;
+    &:hover{
+      text-decoration: underline;
+    }
+  }
 </style>

+ 11 - 16
src/views/salesManagement/salesQueryNew/comps/importGuideModal.vue

@@ -79,14 +79,6 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
-    },
-    params: { // 参数
-      type: Object,
-      default: null
-    },
-    promoProductClz: { // 活动产品类型
-      type: String,
-      default: ''
     }
   },
   data () {
@@ -96,15 +88,20 @@ export default {
       attachAction: process.env.VUE_APP_API_BASE_URL + '/sales/detail/importParse', // 解析地址
       paramsData: null, // 参数数据
       uploadParams: { // 上传参数
-        salesBillSn: this.params.salesBillSn,
-        salesPromoSn: this.params.salesPromoSn || '',
-        promoProductClz: this.promoProductClz || ''
+        salesBillSn: '',
+        salesPromoSn: '',
+        promoProductClz: ''
       },
       exportLoading: false,
-      filePath: location.protocol + '//' + location.host + '/templ/销售导入产品模板.xlsx' // 模板文件地址
+      filePath: location.protocol + '//' + location.host + '/templ/销售导入产品模板.xlsx', // 模板文件地址
+      curRowData: null
     }
   },
   methods: {
+    pageInit (params, row) {
+      this.curRowData = row
+      this.uploadParams = params
+    },
     // 下一步
     handlerNextStep () {
       if (this.paramsData) {
@@ -117,7 +114,7 @@ export default {
     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.params)
+        this.paramsData = Object.assign({}, JSON.parse(file)[0] || null, this.uploadParams)
       } else {
         this.paramsData = null
       }
@@ -125,7 +122,7 @@ export default {
     // 导入
     hanldeOk (obj) {
       if (obj && obj.length > 0) {
-        this.$emit('ok', obj, this.paramsData.salesPromoSn)
+        this.$emit('ok', obj, this.curRowData, this.uploadParams.promoProductClz)
         this.isShow = false
       }
     },
@@ -146,8 +143,6 @@ export default {
         this.$emit('close')
         this.paramsData = null
         this.$refs.importUpload.setFileList('')
-      } else {
-        this.uploadParams.promoProductClz = this.promoProductClz
       }
     }
   }

+ 27 - 180
src/views/salesManagement/salesQueryNew/comps/productList.vue

@@ -1,39 +1,5 @@
 <template>
   <div>
-    <div class="table-page-search-wrapper" v-show="showDescBox">
-      <a-row v-if="descDetail" type="flex" justify="start">
-        <a-col span="6" style="padding: 6px;">
-          <span>促销类型:</span>
-          {{ descDetail.promotionRuleTypeDictValue||'--' }}
-        </a-col>
-        <a-col span="18" style="padding: 6px;">
-          <div style="display: flex;">
-            <div style="display: flex;">
-              <span>促销门槛:</span>
-              <div v-if="descDetail.gateFlag === '1'">
-                {{ descDetail.gateInfo }}
-              </div>
-              <span v-else>无</span>
-            </div>
-            <div style="display: flex;">
-              <div v-if="descDetail.promotionRuleType!='PROMO_PROD'&&descDetail.promotionRuleType!='BUY_PROD_GIVE_MONEY'">
-                <span style="margin-left: 50px;">限制正价产品款数:</span>{{ descDetail.restrictCategory||'无' }}
-              </div>
-              <div>
-                <span style="margin-left: 50px;">订单起订金额(元):</span>{{ descDetail.minOrderAmount||'无' }}
-                <span style="margin-left: 50px;">活动经费上限(元):</span>{{ descDetail.upperLimitAmount||'无' }}
-              </div>
-            </div>
-          </div>
-        </a-col>
-        <a-col span="24" style="padding: 6px;">
-          <div style="display: flex;">
-            <span>促销规则:</span>
-            <div class="ruleInfo" v-html="descDetail.ruleInfo"></div>
-          </div>
-        </a-col>
-      </a-row>
-    </div>
     <!-- 筛选条件 -->
     <div class="table-page-search-wrapper" style="margin:0" v-show="showSearchBox">
       <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
@@ -83,13 +49,12 @@
             class="button-info"
             @click="showSearchBox=!showSearchBox" ><a-icon :type="showSearchBox?'close':'search'"/> 筛选</a-button>
           <!-- // 操作按钮 -->
-          <!-- <a-button type="link" class="button-info" @click="searchThreeStock" id="salesEdit-updateStock"><a-icon type="redo"/>第三方库存</a-button> -->
           <a-dropdown>
             <a-menu slot="overlay" @click="handleMenuClick" :id="'salesEdit-menu-'+id">
-              <a-menu-item key="3" :disabled="disablePromo" :id="'salesEdit-menu-3-'+id">
+              <a-menu-item key="3" :id="'salesEdit-menu-3-'+id">
                 全部仓库设置
               </a-menu-item>
-              <a-menu-item key="0" :disabled="disablePromo" :id="'salesEdit-menu-0-'+id">
+              <a-menu-item key="0" :id="'salesEdit-menu-0-'+id">
                 部分仓库设置
               </a-menu-item>
               <a-menu-divider />
@@ -100,7 +65,7 @@
                 全部删除
               </a-menu-item>
               <a-menu-divider />
-              <a-menu-item key="4" :disabled="disablePromo" :id="'salesEdit-menu-4-'+id">
+              <a-menu-item key="4" :id="'salesEdit-menu-4-'+id">
                 批量取消促销
               </a-menu-item>
             </a-menu>
@@ -110,34 +75,6 @@
               class="button-info"
             > 批量操作 <a-icon type="down" /> </a-button>
           </a-dropdown>
-          <!-- 导入操作 -->
-          <a-dropdown :disabled="disablePromo">
-            <a-menu slot="overlay" @click="handleImportClick" :id="'salesEdit-menu-import-'+id">
-              <a-menu-item :id="'salesEdit-menu-import-gate-'+id" key="GATE" v-if="promo&&promo.promotionRule&&promo.promotionRule.gateFlag==='1'">
-                导入门槛产品
-              </a-menu-item>
-              <a-menu-item :id="'salesEdit-menu-import-regular-'+id" key="REGULAR" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType!='PROMO_PROD'">
-                导入正价产品
-              </a-menu-item>
-              <a-menu-item :id="'salesEdit-menu-import-gift-'+id" key="GIFT" v-if="promo&&promo.promotionRule&&(promo.promotionRule.regularPromotionSameFlag==='0'||promo.promotionRule.scopeFlag==='0'||(promo.promotionRule.promotionRuleType=='BUY_PROD_GIVE_MONEY'&&promo.promotionRule.scopeFlag==='1'))">
-                导入促销产品
-              </a-menu-item>
-              <a-menu-item :id="'salesEdit-menu-import-discount-'+id" key="DISCOUNT" v-if="promo&&promo.promotionRule&&promo.promotionRule.promotionRuleType=='PROMO_PROD'">
-                导入特价产品
-              </a-menu-item>
-            </a-menu>
-            <a-button
-              :id="'salesEdit-menu-import-plaction-'+id"
-              type="link"
-              :class="disablePromo?'button-gray':'button-info'"
-            > 导入产品 <a-icon type="down" /> </a-button>
-          </a-dropdown>
-          <a-button
-            :id="'salesEdit-menu-newProduct-'+id"
-            type="link"
-            :class="disablePromo?'button-gray':'button-info'"
-            :disabled="disablePromo"
-            @click="openCpModal"><a-icon type="plus" /> 添加产品</a-button>
         </a-col>
       </a-row>
     </div>
@@ -272,13 +209,6 @@
       </template>
     </s-table>
 
-    <!-- 导入产品 -->
-    <importGuideModal
-      :openModal="openGuideModal"
-      :params="{salesBillSn: $route.params.sn, salesPromoSn: promo.salesPromoSn}"
-      :promoProductClz="promoProductClz"
-      @close="closeGuideModel"
-      @ok="hanldeImportOk" />
     <!-- 仓库设置 -->
     <setWarehouse :title="warehouseTit" :show="openWarehouseModal" @ok="chooseWarehouseOk" @cancel="openWarehouseModal=false"></setWarehouse>
     <!-- 换促销 -->
@@ -289,7 +219,6 @@
 <script>
 import { commonMixin } from '@/utils/mixin'
 import { STable, VSelect } from '@/components'
-import ImportGuideModal from './importGuideModal.vue'
 import setWarehouse from './setWarehouse.vue'
 import updateActiveModal from './updateActiveModal.vue'
 import chooseWarehouse from '@/views/common/chooseWarehouse'
@@ -303,8 +232,7 @@ import {
   salesDetailDel,
   salesDetailBatchDel,
   deleteAll,
-  updateWarehouse,
-  salesBatchInsert
+  updateWarehouse
 } from '@/api/salesDetailNew'
 
 export default {
@@ -313,8 +241,6 @@ export default {
   components: {
     STable,
     VSelect,
-    // 导入弹框组件
-    ImportGuideModal,
     chooseWarehouse,
     setWarehouse, // 设置仓库组件
     ProductBrand, // 产品品牌组件
@@ -327,6 +253,10 @@ export default {
       default: false
     },
     newLoading: Boolean,
+    activeList: {
+      type: Array,
+      default: () => []
+    },
     // 详情数据
     detailData: {
       type: Object,
@@ -359,7 +289,6 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        this.disablePromo = this.promo.disabled
         this.queryParam.salesBillSn = this.salesBillSn || ''
         this.getCount()
         return salesDetailList(Object.assign(parameter, this.queryParam, {
@@ -392,9 +321,7 @@ export default {
         })
       },
       showSearchBox: false, // 是否显示筛选条件
-      showDescBox: false, // 收起展开规则详细
       openWarehouseModal: false, // 打开仓库设置
-      openGuideModal: false, //  导入产品引导
       delLoading: false, // 删除logding
       disabled: false, //  查询、重置按钮是否可操作
       queryParam: {
@@ -411,8 +338,6 @@ export default {
       warehouseDataList: [], // 仓库列表数据
       openUpActiveModal: false, // 更换促销活动弹框
       descDetail: null, // 规则详细数据
-      promoProductClz: null, // 活动产品分类
-      disablePromo: false, // 是否禁用活动
       countData: null, // 统计信息
       warehouseTit: '', // 仓库设置唐卡标题
       showStockCol: false // 第三方库存是否显示
@@ -484,18 +409,6 @@ export default {
       this.showStockCol = true
       this.resetSearchForm()
     },
-    // 显示规则详细
-    showDesc (descDetail) {
-      this.showDescBox = !this.showDescBox
-      this.descDetail = descDetail
-      this.descDetail.gateValue = Number(this.descDetail.gateValue).toFixed(2)
-      this.descDetail.quotaAmount = Number(this.descDetail.quotaAmount).toFixed(2)
-      this.$emit('showDesc', this.showDescBox)
-    },
-    // 打开产品弹框
-    openCpModal () {
-      this.$emit('openCpModal', 1, this.id, this.countData)
-    },
     // 表格选中项
     rowSelectionFun (obj) {
       this.rowSelectionInfo = obj || null
@@ -506,10 +419,6 @@ export default {
       this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
       this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
     },
-    // 禁用活动
-    disableActive (flag) {
-      this.disablePromo = flag
-    },
     // 统计
     getCount () {
       salesPromoDetailCount(Object.assign(this.queryParam, {
@@ -540,17 +449,33 @@ export default {
     // 批量取消出现产品
     handleBatchCancelActive () {
       const _this = this
-      if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length < 1)) {
+      const len = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRowKeys.length
+      if (!_this.rowSelectionInfo || (len < 1)) {
         _this.$message.warning('请先选择产品后再进行批量操作!')
         return
       }
       const obj = []
+      const gift = []
       _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows.map(item => {
-        obj.push(item.salesBillDetailSn)
+        // 赠品
+        if (item.promotionFlag == 'GIFT') {
+          gift.push(item.productCode)
+        } else {
+          obj.push(item.salesBillDetailSn)
+        }
       })
+      if (gift.length == len) {
+        this.$info({
+          title: '提示',
+          content: '所选全部为赠品,其不能转为正常产品!',
+          centered: true,
+          okText: '知道了'
+        })
+        return
+      }
       this.$confirm({
         title: '提示',
-        content: '已选产品' + obj.length + '项,确认要批量取消促销转为正常产品吗?',
+        content: '已选产品' + len + '项,' + (gift.length ? '其中包含赠品' + gift.join(',') + '(赠品不能转正常产品),确认要继续批量取消促销转为正常产品吗?' : '确认要批量取消促销转为正常产品吗?'),
         centered: true,
         onOk () {
           _this.spinning = true
@@ -757,84 +682,6 @@ export default {
       this.openUpActiveModal = false
       this.$refs.table.clearSelected()
       this.$refs.table.refresh(false)
-    },
-    // 添加产品
-    insterProduct (row, promotionFlag, promoProductClz) {
-      // 防止多次添加产品
-      if (this.isInster) { return }
-      this.saveNewProduct(row, promotionFlag, promoProductClz)
-    },
-    // 保存添加的产品到销售列表
-    saveNewProduct (row, promotionFlag, promoProductClz) {
-      this.$message.loading('正在添加产品...', 1)
-      this.isInster = true
-      this.spinning = true
-      const params = {
-        salesPromoSn: this.promo.salesPromoSn,
-        promoRuleSn: this.promo.promoRuleSn,
-        promoSn: this.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: promotionFlag, // 促销标记 正品传0,促销品传1
-        warehouseSn: row.warehouseSn
-      }
-      salesDetailInsert(params).then(res => {
-        if (res.status == 200) {
-          this.$message.success('产品添加成功', 2.5)
-          this.resetSearchForm(true)
-          this.$emit('insterOk', 'promo')
-        }
-        this.spinning = false
-        this.isInster = false
-      }).catch(err => {
-        this.isInster = false
-        this.spinning = false
-      })
-    },
-    // 导入产品
-    handleImportClick (e) {
-      console.log(e)
-      this.openGuideModal = true
-      this.promoProductClz = e.key
-    },
-    // 关闭导入弹框
-    closeGuideModel () {
-      this.openGuideModal = false
-      this.promoProductClz = ''
-    },
-    // 批量导入产品
-    hanldeImportOk (data, salesPromoSn) {
-      const params = {
-        salesBillSn: this.detailData.salesBillSn,
-        salesBillDetailList: data
-      }
-      // 活动导入
-      if (salesPromoSn) {
-        params.salesPromoSn = salesPromoSn
-        params.promoRuleSn = this.promo.promoRuleSn
-        params.promoProductClz = this.promoProductClz
-      }
-      salesBatchInsert(params).then(res => {
-        if (res.status == 200) {
-          this.$message.success('产品导入成功', 2.5)
-          this.resetSearchForm(true)
-          this.$emit('insterOk', 'promo')
-        }
-      })
     }
   }
 }

+ 2 - 6
src/views/salesManagement/salesQueryNew/comps/productNormalList.vue

@@ -593,14 +593,10 @@ export default {
         }
       })
     },
-    // 添加产品
-    insterProduct (row, promotionFlag) {
-      // 防止多次添加产品
-      if (this.isInster) { return }
-      this.saveNewProduct(row, promotionFlag)
-    },
     // 保存添加的产品到销售列表
     saveNewProduct (row, promotionFlag) {
+      // 防止多次添加产品
+      if (this.isInster) { return }
       this.$message.loading('正在添加产品...', 1)
       this.isInster = true
       this.spinning = true

+ 20 - 155
src/views/salesManagement/salesQueryNew/edit.vue

@@ -57,46 +57,34 @@
       >
         <activeStatisticsList
           ref="activeTjList"
+          @openCpModal="openProductModal"
+          @insterOk="insterActiveOk"
+          @upActive="upActive"
           :activeList="activeList"
           :warehouseSn="warehouseSn"
           :salesBillSn="salesBillSn"
         ></activeStatisticsList>
       </a-card>
-      <!-- 活动产品 -->
+      <!-- 活动产品列表 -->
       <a-card
         size="small"
         :bordered="false"
         class="salesEdit-cont"
-        v-for="item in activeList"
-        :key="item.promoRuleSn"
+        title="活动产品"
         v-if="activeList.length"
       >
-        <div slot="title" style="display: inline-block;width:100%;">
-          <strong style="margin-right:10px;font-size:14px;">{{ item.promotion.description }}</strong> ({{ item.promotionRule.description }})
-          <span style="margin-left:20px;color:#00aaff;cursor: pointer;" @click="(event) => {showDesc(event, item)}">
-            <a-icon :type="item.showDesc ? 'eye-invisible' : 'eye'"/> 活动详情
-          </span>
-          <span :style="{margin:'0 20px',color:item.disabled?'#14b900':'#ff0800',cursor: 'pointer'}" @click="(event) => {disenablePromp(event, item)}">
-            <a-icon title="禁用规则" :type="item.disabled?'link':'disconnect'"/> {{ item.disabled ? '启用规则' : '禁用规则' }}
-          </span>
-        </div>
-        <div slot="extra" @click="tooglePanel(item)" style="cursor: pointer;">{{ item.isActive ? '收起' : '展开' }} <a-icon type="caret-right" :rotate="item.isActive ? 90 : 0"/> </div>
-        <div v-show="item.isActive" style="padding: 10px;">
+        <div style="padding: 10px;">
           <productList
-            :ref="'productList-'+item.promoRuleSn"
-            :id="item.promoRuleSn"
-            @openCpModal="openProductModal"
-            @insterOk="insterActiveOk"
-            @spinning="e=>spinning=e"
-            @showDesc="v => showDescOk(v,item)"
-            @upActive="upActive"
-            :promo="item"
+            ref="productList-active-list"
+            :activeList="activeList"
             :detailData="detailData"
             :warehouseSn="warehouseSn"
-            :salesBillSn="salesBillSn"></productList>
+            :salesBillSn="salesBillSn">
+          </productList>
         </div>
       </a-card>
     </a-spin>
+    <!-- 底部栏 -->
     <div class="affix-cont">
       <div class="footer-price">
         <div></div>
@@ -159,7 +147,8 @@
       ref="chooseProduct"
       :openModal="showCpModal"
       @close="closeProductModal"
-      @addProduct="insterProduct"></chooseProduct>
+      @addProduct="insterProduct">
+    </chooseProduct>
     <!-- 新活动窗口 -->
     <newPromoModal
       :show="showNewActiveModal"
@@ -177,7 +166,7 @@ import productNormalList from './comps/productNormalList.vue'
 import activeStatisticsList from './comps/activeStatisticsList.vue'
 import chooseProduct from './comps/chooseProduct.vue'
 import newPromoModal from './newPromoModal.vue'
-import { salesDisablePromo, salesEnablePromoPromo, salesChangePromo } from '@/api/salesDetailNew'
+import { salesChangePromo } from '@/api/salesDetailNew'
 import { salesDetailBySn, salesPromoQueryCount, salesWriteSubmit, submitCheck, updateBatch, salesPromoQueryList, salesQueryUnPartPromo, salesPromoValidaSubmit, getThirdStockQty } from '@/api/salesNew'
 export default {
   name: 'SalesNewEdit',
@@ -205,7 +194,7 @@ export default {
       },
       showDetail: false, // 显示详细基本信息
       showCpModal: false, // 添加产品弹框
-      cpCurRefId: '', // 当前操作的活动id
+      cpCurRefId: 'productList-active-list', // 活动产品列表ref
       disabledActiveOption: null, // 禁用活动选项
       yhDetail: null, // 优惠明细
       showNewActiveModal: false // 新活动弹框
@@ -356,17 +345,11 @@ export default {
     },
     // 添加产品后,关闭弹框
     closeProductModal (type) {
-      this.cpCurRefId = ''
       this.showCpModal = false
     },
     // 打开选择产品弹框
-    openProductModal (type, refId, countData) {
-      const promo = this.activeList.find(item => item.promoRuleSn == refId)
-      if (promo) {
-        promo.countData = countData
-      }
+    openProductModal (type, promo) {
       this.$refs.chooseProduct.pageInit(this.detailData, promo, type)
-      this.cpCurRefId = 'productList-' + refId
       this.showCpModal = true
     },
     // 添加活动产品成功的回调
@@ -394,14 +377,14 @@ export default {
       // 重新获取详情信息
       this.getOrderDetail()
     },
-    // 单击新增产品
+    // 确定新增产品
     insterProduct (row, promotionFlag, type) {
       // 正常产品
       if (type == 0) {
-        this.$refs.productNormalList.insterProduct(row, promotionFlag)
+        this.$refs.productNormalList.saveNewProduct(row, promotionFlag)
       } else {
-        // 活动产品
-        this.$refs[this.cpCurRefId][0].insterProduct(row, promotionFlag, type)
+        // 活动产品对象
+        this.$refs[this.cpCurRefId][0].saveNewProduct(row, promotionFlag, type)
       }
     },
     // 正常产品添加到活动
@@ -539,124 +522,6 @@ export default {
       }
       this.spinning = false
     },
-    // 展开收缩活动详情
-    showDesc (e, item) {
-      e.stopPropagation()
-      const row = this.$refs['productList-' + item.promoRuleSn][0]
-      item.promotionRule.minOrderAmount = item.promotion.minOrderAmount ? Number(item.promotion.minOrderAmount).toFixed(2) : ''
-      item.promotionRule.upperLimitAmount = item.promotion.upperLimitAmount ? Number(item.promotion.upperLimitAmount).toFixed(2) : ''
-      row && row.showDesc(item.promotionRule)
-    },
-    // 展开活动规则详情回调
-    showDescOk (v, item) {
-      item.showDesc = v
-      if (!item.isActive) {
-        const row = this.$refs['productList-' + item.promoRuleSn][0]
-        row && row.resetSearchForm()
-        item.isActive = true
-      }
-      this.activeList.splice()
-    },
-    // 启用规则
-    enabledActive (e, item) {
-      const _this = this
-      this.spinning = true
-      salesEnablePromoPromo({
-        salesBillSn: _this.salesBillSn,
-        salesPromoSn: item.salesPromoSn
-      }).then(res => {
-        if (res.status == 200) {
-          item.disabled = false
-          item.isActive = true
-          _this.activeList.splice()
-          // 禁用按钮
-          _this.$refs['productList-' + item.promoRuleSn][0].disableActive(false)
-
-          // 刷新所有表格
-          _this.updateAllTable(true)
-
-          _this.spinning = false
-          _this.$message.success('操作成功,请添加产品')
-        }
-      })
-    },
-    // 禁用规则
-    disabledActive (e, item) {
-      const _this = this
-      _this.spinning = true
-      salesDisablePromo({
-        salesBillSn: _this.salesBillSn,
-        salesPromoSn: item.salesPromoSn,
-        promoRuleSn: item.promoRuleSn,
-        salesDisableType: _this.disabledActiveOption
-      }).then(res => {
-        if (res.status == 200) {
-          item.disabled = true
-          item.isActive = false
-          _this.activeList.splice()
-          // 启用按钮
-          _this.$refs['productList-' + item.promoRuleSn][0].disableActive(true)
-
-          // 刷新所有表格
-          _this.updateAllTable(true)
-
-          _this.disabledActiveOption = null
-          _this.spinning = false
-          _this.$message.success('操作成功')
-        }
-      })
-    },
-    // 禁用启用活动规则
-    disenablePromp (e, item) {
-      const _this = this
-      const table = _this.$refs['productList-' + item.promoRuleSn][0]
-
-      // 是否启用规则
-      if (item.disabled) {
-        this.enabledActive(e, item)
-        return
-      }
-      // 如果没有活动产品,直接禁用无需弹框提示
-      if (!table.countData || table.countData && !table.countData.totalQty) {
-        _this.disabledActiveOption = 'DELETE'
-        _this.disabledActive(e, item)
-        return
-      }
-      // 弹框提示禁用方式
-      this.$confirm({
-        title: '确定禁用规则?',
-        centered: true,
-        class: 'confirm-center',
-        content: <div>
-          <div style="padding:10px 0;text-align:center;">禁用规则后,将无法享受该活动规则优惠</div>
-          <div style="padding:0 0 10px 0;text-align:center;">
-            <aRadioGroup onChange={_this.changeDaOpt}>
-              <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="DELETE">
-                删除规则中相关产品
-              </aRadio>
-              <aRadio style="display:block;height: '30px';lineHeight: '30px';padding:5px 0;" value="REMOVE">
-                移出规则中相关产品
-              </aRadio>
-            </aRadioGroup>
-          </div>
-        </div>,
-        onOk () {
-          if (_this.disabledActiveOption) {
-            _this.disabledActive(e, item)
-          } else {
-            _this.$message.info('请选择禁用方式!')
-            return true
-          }
-        },
-        onCancel () {
-          _this.disabledActiveOption = null
-        }
-      })
-    },
-    // 选择禁用活动选项
-    changeDaOpt (e) {
-      this.disabledActiveOption = e.target.value
-    },
     // 页面初始化
     pageInit () {
       this.salesBillSn = this.$route.params.sn

+ 13 - 13
src/views/salesReturnManagement/salesReturn/auditDetail.vue

@@ -2,15 +2,15 @@
   <div>
     <p>说明:以下信息来自钉钉</p>
     <a-spin :spinning="spinning" tip="Loading...">
-      <div style="margin-bottom:10px;" v-for="item in list" :key="item.businessId">
-        <div style="margin-bottom:10px;font-weight:bold;">提审时间:{{ item.createTime }}</div>
+      <div style="margin-bottom:10px;" v-for="item in list" :key="item.businessSn">
+        <div style="margin-bottom:10px;font-weight:bold;">提审时间:{{ item.createDate }}</div>
         <a-table
           class="sTable fixPagination"
           ref="table"
           size="small"
-          :rowKey="(record) => record.businessId"
+          :rowKey="(record) => record.businessSn"
           :columns="columns"
-          :dataSource="item.taskVOList"
+          :dataSource="item.opinionList"
           :scroll="{ y: 500 }"
           :pagination="false"
           bordered>
@@ -22,7 +22,7 @@
 
 <script>
 import { STable } from '@/components'
-import { getProcessInstanceList } from '@/api/expenseManagement'
+import { getProcessInstance } from '@/api/expenseManagement'
 export default {
   name: 'AuditDetail',
   components: { STable },
@@ -44,12 +44,12 @@ export default {
     return {
       spinning: false,
       columns: [{ title: '序号', dataIndex: 'no', width: '8%', align: 'center' },
-        { title: '人员姓名', width: '12%', dataIndex: 'userName', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '人员类型', dataIndex: 'userType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '状态', dataIndex: 'state', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '审批意见', dataIndex: 'remark', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '附件', dataIndex: 'hasAttachments', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '操作时间', dataIndex: 'date', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
+        { title: '人员姓名', width: '12%', dataIndex: 'approvalName', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '人员类型', dataIndex: 'processTaskType', width: '15%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '状态', dataIndex: 'approvalStateDictValue', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '审批意见', dataIndex: 'approvalOpinion', width: '20%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '附件', dataIndex: 'attachmentNames', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '操作时间', dataIndex: 'approvalTime', width: '20%', align: 'center', customRender: function (text) { return text || '--' } }],
       list: []
     }
   },
@@ -62,11 +62,11 @@ export default {
     },
     getData () {
       this.spinning = true
-      getProcessInstanceList({ businessType: this.businessType, businessSn: this.itemSn }).then(res => {
+      getProcessInstance({ businessType: this.businessType, businessSn: this.itemSn }).then(res => {
         if (res.status == 200) {
           this.list = res.data
           this.list.map(item => {
-            item.taskVOList.map((a, index) => a.no = index + 1)
+            item.opinionList.map((a, index) => a.no = index + 1)
           })
         }
         this.spinning = false

+ 3 - 2
src/views/setting/dataValidManagement/list.vue

@@ -12,7 +12,7 @@
             </a-col>
             <a-col :md="4" :sm="24">
               <a-form-item label="校验结果">
-                <a-select clearable placeholder="请选择校验结果" id="erpMessageManagement-checkResult" v-model="queryParam.resultType">
+                <a-select clearable placeholder="请选择校验结果" id="erpMessageManagement-checkResult" allowClear v-model="queryParam.resultType">
                   <a-select-option value="right" id="erpMessageManagement-checkResult-success">
                     成功
                   </a-select-option>
@@ -76,8 +76,9 @@
               <a-button
                 size="small"
                 type="link"
-                class="button-info"
+                class="button-error"
                 @click="handleCli(record)"
+                v-if="record.resultType!='right'"
                 :id="'erpMessageManagement-handle-btn'+record.id">处理</a-button>
               <a-button
                 v-if="record.bizNo"