瀏覽代碼

bug 修改

lilei 7 月之前
父節點
當前提交
55f89ce285

+ 13 - 0
src/api/salesNew.js

@@ -481,3 +481,16 @@ export const salesOverviewQueryPage = (params) => {
     }
   })
 }
+
+// 累计产品选择列表
+export const salesDetailQueryBorrowPageList = (params) => {
+  const url = `/sales/detail/queryWaitBorrowPage/${params.pageNo}/${params.pageSize}`
+  return axios({
+    url: url,
+    data: params,
+    method: 'post',
+    headers: {
+      'module': encodeURIComponent('选择累计产品列表')
+    }
+  })
+}

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

@@ -83,7 +83,7 @@
           <template slot="promotionName" slot-scope="text, record">
             <div :id="'promotionList-info-'+record.id" v-if="$hasPermissions('B_dealerPromotionDetail')" class="link-bule nameBox">
               <span @click="handleDetail(record)" style="vertical-align: middle;">{{ record.title }}</span>
-              <a-badge count="叠" v-show="record.stackFlag == 1" :number-style="{ backgroundColor: '#F5222D', marginLeft:'5px', zoom:'80%' }" />
+              <a-badge count="叠" v-show="record.stackFlag == 1" :number-style="{ backgroundColor: '#00aa00', marginLeft:'5px', zoom:'80%' }" />
               <a-badge count="累" v-show="record.borrowFlag == 1" :number-style="{ backgroundColor: '#F5222D', marginLeft:'5px', zoom:'80%' }" />
             </div>
             <div v-else class="nameBox text-overflows2">{{ record.title }}</div>

+ 13 - 7
src/views/salesManagement/salesQueryNew/comps/activeStatisticsList.vue

@@ -154,8 +154,14 @@ export default {
           align: 'center',
           fixed: 'left',
           renderBodyCell: ({ row, column, rowIndex }, h) => {
-            return (<div class="table-link-text" title={row[column.field]} onClick={() => _this.showDesc(row)}>
-              <div style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title={row[column.field]}>{row[column.field]}</div>
+            return (<div style="width:100%;display:flex;justify-content: space-between;" title={row[column.field]} onClick={() => _this.showDesc(row)}>
+              <div class="table-link-text" title={row[column.field]}>
+                <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">{row[column.field]}</span>
+              </div>
+              <div style="width:80px;">
+                {row.promotion.stackFlag == 1 ? <a-badge count="叠" numberStyle={{ backgroundColor: '#00aa00', marginLeft: '3px', zoom: '80%' }}/> : ''}
+                {row.promotion.borrowFlag == 1 ? <a-badge count="累" numberStyle={{ backgroundColor: '#F5222D', marginLeft: '3px', zoom: '80%' }} /> : ''}
+              </div>
             </div>)
           }
         },
@@ -360,15 +366,15 @@ export default {
                   type="link"
                   size="small"
                   class="button-primary"
-                  on-click={() => this.addProduct(row)}
+                  on-click={() => this.addProduct(row, 1)}
                 >
                  添加
                 </a-button> : ''}
-                {row.enabledFlag == 1 ? <a-button
+                {row.enabledFlag == 1 && row.promotion.borrowFlag == 1 ? <a-button
                   type="link"
                   size="small"
                   class="button-primary"
-                  on-click={() => this.addProduct(row)}
+                  on-click={() => this.addProduct(row, 2)}
                 >
                  累计
                 </a-button> : ''}
@@ -582,8 +588,8 @@ export default {
       })
     },
     // 添加产品
-    addProduct (row) {
-      this.$emit('openCpModal', 1, row)
+    addProduct (row, type) {
+      this.$emit('openCpModal', type, row)
     },
     // 查看活动详情
     showDesc (row) {

+ 10 - 3
src/views/salesManagement/salesQueryNew/comps/chooseProduct.vue

@@ -1,7 +1,7 @@
 <template>
   <a-drawer
     :zIndex="zIndex"
-    title="选择产品"
+    :title="title"
     placement="right"
     :visible="isShow"
     width="80%"
@@ -14,8 +14,12 @@
       <div class="products-con">
         <div>
           <!-- 查询配件列表 -->
+          <!-- 正常产品 -->
           <queryPart v-if="cptype==0" ref="partQuery" :newLoading="isInster" @add="insterProduct"></queryPart>
+          <!-- 活动产品 -->
           <activeQueryPart v-if="cptype==1" ref="partQuery" :newLoading="isInster" @add="insterProduct"></activeQueryPart>
+          <!-- 累计产品 -->
+          <cumulativeProduct v-if="cptype==2" ref="partQuery" :newLoading="isInster" @add="insterProduct"></cumulativeProduct>
         </div>
       </div>
     </a-spin>
@@ -25,9 +29,10 @@
 <script>
 import queryPart from './queryPart.vue'
 import activeQueryPart from './activeQueryPart.vue'
+import cumulativeProduct from './cumulativeProduct.vue'
 export default {
   name: 'ChooseProductsModal',
-  components: { queryPart, activeQueryPart },
+  components: { queryPart, activeQueryPart, cumulativeProduct },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -54,7 +59,8 @@ export default {
       cptype: 3, // 组件类型
       isShow: this.openModal, //  是否打开弹框
       orderData: null, // 订单数据
-      promoData: null //  促销活动数据
+      promoData: null, //  促销活动数据
+      title: '选择产品'
     }
   },
 
@@ -74,6 +80,7 @@ export default {
       this.cptype = type
       this.orderData = data
       this.promoData = promo
+      this.title = type == 2 ? '累计产品' : '选择产品'
       this.$nextTick(() => {
         this.$refs.partQuery.pageInit(data, promo)
       })

+ 258 - 0
src/views/salesManagement/salesQueryNew/comps/cumulativeProduct.vue

@@ -0,0 +1,258 @@
+<template>
+  <div class="cumulativeProductList-wrap">
+    <!-- 搜索条件 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchForm">
+        <a-row :gutter="15">
+          <a-col :md="6" :sm="24">
+            <a-form-item label="客户名称">
+              <dealerSubareaScopeList ref="dealerSubareaScopeList" id="cumulativeProductList-buyerName" @change="custChange" />
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="产品编码">
+              <a-input id="cumulativeProductList-code" v-model.trim="queryParam.productCode" allowClear placeholder="请输入产品编码"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="24">
+            <a-form-item label="销售单号">
+              <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-origCode" v-model.trim="queryParam.productOrigCode" allowClear placeholder="请输入原厂编码"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品品牌">
+                <ProductBrand id="cumulativeProductList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="产品分类">
+                <ProductType id="cumulativeProductList-productType" v-model="productType" @change="changeProductType"></ProductType>
+              </a-form-item>
+            </a-col>
+          </template>
+          <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+            <a-button type="primary" @click="searchForm" :disabled="disabled" id="cumulativeProductList-refresh">查询</a-button>
+            <a-button style="margin-left: 5px" @click="resetSearchForm" id="cumulativeProductList-reset">重置</a-button>
+            <a @click="advanced=!advanced" style="margin: 0 5px">
+              {{ advanced ? '收起' : '展开' }}
+              <a-icon :type="advanced ? 'up' : 'down'"/>
+            </a>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+    <!-- tab选项卡 -->
+    <a-tabs type="card" @change="changeTab">
+      <a-tab-pane v-for="item in tabList" :key="item.val" :tab="item.text"></a-tab-pane>
+    </a-tabs>
+    <div class="table-operator">
+      <a-button type="primary" @click="handleAdd">批量添加</a-button>
+      <span v-if="selectTotal" style="margin-left:10px;">已选{{ selectTotal }}项</span>
+    </div>
+    <!-- 列表 -->
+    <s-table
+      class="sTable"
+      ref="table"
+      size="small"
+      :rowKey="(record) => record.borrowBillSn"
+      rowKeyName="borrowBillSn"
+      :columns="columns"
+      :data="loadData"
+      :row-selection="{ columnWidth: 40 }"
+      @rowSelection="rowSelectionFun"
+      :scroll="{ y: tableHeight, x: 1040 }"
+      :defaultLoadData="false"
+      :pageSize="50"
+      bordered>
+    </s-table>
+  </div>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { salesDetailQueryBorrowPageList } from '@/api/salesNew'
+import ProductType from '@/views/common/productType.js'
+import ProductBrand from '@/views/common/productBrand.js'
+import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
+import { STable, VSelect } from '@/components'
+export default {
+  name: 'ActiveQueryPart',
+  mixins: [commonMixin],
+  components: { STable, VSelect, ProductBrand, ProductType, dealerSubareaScopeList },
+  props: {
+    newLoading: Boolean
+  },
+  data () {
+    return {
+      advanced: false, // 高级搜索 展开/关闭
+      showSetting: false, // 设置弹框
+      productType: [], // 产品类型
+      buyerSn: '', // 客户sn
+      queryParam: { //  查询条件
+        buyerSn: undefined, //  客户名称
+        productCode: '', //  产品编码
+        salesBillNo: '', // 销售单号
+        productName: '', //  产品名称
+        productOrigCode: '', //  原厂编码
+        productBrandSn: undefined, //  产品品牌
+        productTypeSn1: '', //  产品一级分类
+        productTypeSn2: '', //  产品二级分类
+        productTypeSn3: '' //  产品三级分类
+      },
+      tableHeight: 300, // 表格高度
+      disabled: false, //  查询、重置按钮是否可操作
+      promoProductClz: 'GATE', // 促销产品类型
+      promoRuleData: null, // 促销规则数据
+      tabList: [], // 促销产品选项卡
+      rowSelectionInfo: null, // 已选择
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        return salesDetailQueryBorrowPageList(Object.assign(parameter, this.queryParam, { onlineFalg: '1' })).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            data.list = data.list.filter(item => item != null)
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+              // 产品包装数
+              const productPackQty = (data.list[i].packQty || data.list[i].packQty == 0) ? data.list[i].packQty : '--'
+              const productUnit = data.list[i].productEntity.unit || '--'
+              const productPackQtyUnit = data.list[i].packQtyUnit || '--'
+              data.list[i].packQtyV = productPackQty + productUnit + '/' + productPackQtyUnit
+            }
+            this.disabled = false
+          }
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    // 已选产品数量
+    selectTotal () {
+      return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
+    },
+    columns () {
+      const arr = [
+        { title: '序号', dataIndex: 'no', width: '4%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '销售单号', dataIndex: 'borrowBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'buyerName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '产品编码', dataIndex: 'productCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'productEntity.name', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '原厂编码', dataIndex: 'productEntity.origCode', width: '150px', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '品牌', dataIndex: 'productEntity.productBrandName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '单位', dataIndex: 'productEntity.unit', width: '60px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '包装数', dataIndex: 'packQtyV', width: '60px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '销售数量', dataIndex: 'qty', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      const idx = 7
+      if (this.$hasPermissions('B_salesEdit_salesPrice')) { // 售价权限
+        arr.splice(idx, 0, { title: '售价', dataIndex: 'price', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+        arr.splice(idx + 1, 0, { title: '价格级别', dataIndex: 'priceLevelDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } })
+        arr.push({ title: '售价小计', dataIndex: 'totalAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  watch: {
+    advanced (a, b) {
+      this.tableHeight = window.innerHeight - (a ? 375 : 330)
+    }
+  },
+  methods: {
+    // 选择客户
+    custChange (val) {
+      this.queryParam.buyerSn = val.key
+    },
+    // 表格选中项
+    rowSelectionFun (obj) {
+      this.rowSelectionInfo = obj || null
+    },
+    // 切换tab
+    changeTab (e) {
+      this.promoProductClz = e
+      this.resetSearchForm()
+    },
+    // 查询
+    searchForm () {
+      this.$refs.table.refresh(true)
+    },
+    // 重置
+    resetSearchForm () {
+      this.queryParam.productCode = ''
+      this.queryParam.productName = ''
+      this.queryParam.salesBillNo = ''
+      this.queryParam.productOrigCode = ''
+      this.queryParam.productBrandSn = undefined
+      this.queryParam.productTypeSn1 = ''
+      this.queryParam.productTypeSn2 = ''
+      this.queryParam.productTypeSn3 = ''
+      this.productType = []
+      this.queryParam.buyerSn = undefined
+      this.$refs.dealerSubareaScopeList.resetForm()
+      this.$refs.table.refresh(true)
+    },
+    // 页面初始化
+    pageInit (data, promo) {
+      this.promoRuleData = promo.promotionRule
+      this.queryParam.salesBillSn = data.salesBillSn
+      this.queryParam.salesPromoSn = promo.salesPromoSn
+      // 选项卡数据
+      const tabList = []
+      if (this.promoRuleData) {
+        if (this.promoRuleData.gateFlag === '1') {
+          tabList.push({ text: '门槛产品', val: 'GATE' })
+        }
+        if (this.promoRuleData.promotionRuleType != 'PROMO_PROD') {
+          tabList.push({ text: '正价产品', val: 'REGULAR' })
+        }
+      }
+      this.tabList = tabList
+      this.promoProductClz = tabList[0].val
+      this.tableHeight = window.innerHeight - 330
+      this.resetSearchForm()
+    },
+    // 刷新当前页面
+    resetCurForm () {
+      const _this = this
+      _this.$nextTick(() => {
+        _this.$refs.table.refresh()
+      })
+    },
+    // 添加产品
+    handleAdd () {
+      if (this.selectTotal == 0) {
+        this.$message.warning('请先选择产品后再进行批量操作!')
+        return
+      }
+      this.$emit('add', this.rowSelectionInfo, this.promoProductClz)
+    },
+    // 选择产品分类  change
+    changeProductType (val, opt) {
+      this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
+      this.queryParam.productTypeSn2 = val[1] ? val[1] : ''
+      this.queryParam.productTypeSn3 = val[2] ? val[2] : ''
+    }
+  }
+}
+</script>
+<style lang="less" scoped>
+  .cumulativeProductList-wrap{
+    /deep/ .ant-tabs-bar{
+      margin-bottom: 5px!important;
+    }
+  }
+</style>

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

@@ -320,13 +320,13 @@ export default {
       // 重新获取详情信息
       this.getOrderDetail(false)
     },
-    // 确定新增产品到列表
+    // 确定新增产品到列表,
     insterProduct (row, promo, type) {
       // 正常产品
       if (type == 0) {
         this.$refs.productNormalList.saveNewProduct(row, promo)
       } else {
-        // 活动产品对象
+        // 活动产品对象,type 是 promoProductClz
         this.$refs.productActiveList.saveNewProduct(row, promo, type)
       }
     },