chenrui hai 1 ano
pai
achega
4412d9b12f
Modificáronse 1 ficheiros con 31 adicións e 21 borrados
  1. 31 21
      src/views/reportData/promotionSalesOrderReport/list.vue

+ 31 - 21
src/views/reportData/promotionSalesOrderReport/list.vue

@@ -62,7 +62,7 @@
               </a-col>
               <a-col :md="6" :sm="24">
                 <a-form-item label="产品品牌">
-                  <ProductBrand id="productInfoList-productBrandSn" v-model="queryParam.productBrandSn"></ProductBrand>
+                  <ProductBrand id="productInfoList-productBrand" v-model="queryParam.productBrand"></ProductBrand>
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -99,7 +99,7 @@
           class="sTable fixPagination"
           ref="table"
           size="small"
-          :defaultLoadData="false"
+          :defaultLoadData="true"
           :rowKey="(record) => record.no"
           rowKeyName="no"
           :columns="columns"
@@ -181,8 +181,8 @@ export default {
       tableHeight: 0,
       showExport: false,
       queryParam: { //  查询条件
-        brandTypeBeginDate: undefined,
-        brandTypeEndDate: undefined,
+        brandTypeBeginDate: moment().format('YYYYMM'),
+        brandTypeEndDate: moment().format('YYYYMM'),
         dealerSn: undefined,
         provinceSn: undefined,
         subareaArea: {
@@ -190,29 +190,29 @@ export default {
           subareaAreaSn: undefined,
           bizUserSn: undefined
         },
-        product_brand: undefined,
+        productBrand: undefined,
         productTypeSn1: '', //  产品一级分类
-        product_type: '', //  产品二级分类
+        productType: '', //  产品二级分类
         dealerType: undefined
       },
       productType: [],
       form: {
-        monthInfo: []
+        monthInfo: [moment().format('YYYY-MM'), moment().format('YYYY-MM')]
       },
       columns: [
         { title: '区域', dataIndex: 'subareaArea.subareaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '区域负责人', dataIndex: 'bizUserName', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '省份', dataIndex: 'dealerInfo.provinceName', width: '100px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealerInfo.dealerName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '客户名称', dataIndex: 'dealerInfo.dealerName', width: '130px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
         { title: '客户类型', dataIndex: 'dealerInfo.dealerTypeDictValue', width: '90px', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '品牌', dataIndex: 'brandName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandName' } },
         { title: '二级分类', dataIndex: 'brandtypeName', width: '90px', align: 'center', scopedSlots: { customRender: 'brandtypeName' } },
         { title: '销售额', dataIndex: 'totalSaleAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
         { title: '促销成本费用', dataIndex: 'promoCostFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
         { title: '促销成本费用比', dataIndex: 'promoCostFeeRate', width: '96px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
-        { title: '促销销售费用', dataIndex: ' promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
-        { title: '促销销售费用比', dataIndex: ' promoSaleFeeRate', width: '96px', align: 'center', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
+        { title: '促销销售费用', dataIndex: 'promoSaleFee', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
+        { title: '促销销售费用比', dataIndex: 'promoSaleFeeRate', width: '96px', align: 'right', customRender: text => (text ? this.toThousands(text * 100) + '%' : '--') },
         { title: '参与活动销售额', dataIndex: 'promoSaleAmount', width: '96px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
         { title: '未参与活动销售额', dataIndex: 'notpromotionSale', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
         { title: '调拨物料费用', dataIndex: 'allocateAmount', width: '90px', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
@@ -226,15 +226,19 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false,
-      startValue: null, // 统计月份
-      endValue: null,
+      startValue: moment().format('YYYY-MM'), // 统计月份
+      endValue: moment().format('YYYY-MM'),
       endOpen: false,
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
         this.spinning = true
-        const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const newParamsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
+        const paramsPage = JSON.parse(JSON.stringify(newParamsPage))
         delete paramsPage.productTypeSn1
+        if (!paramsPage.subareaArea.subareaSn && !paramsPage.subareaArea.subareaAreaSn && !paramsPage.subareaArea.bizUserSn) {
+          delete paramsPage.subareaArea
+        }
         return brandTypeReportList(paramsPage).then(res => {
           let data
           if (res.status == 200) {
@@ -348,24 +352,30 @@ export default {
     },
     //  产品分类  change
     changeProductType (val, opt) {
+      if (val.length < 2) {
+        this.$message.error('请选择二级分类')
+        this.disabled = true
+        return
+      }
       this.queryParam.productTypeSn1 = val[0] ? val[0] : ''
-      this.queryParam.product_type = val[1] ? val[1] : ''
+      this.queryParam.productType = val[1] ? val[1] : ''
+      this.disabled = false
     },
     //  重置
     resetSearchForm () {
-      this.form.monthInfo = []
-      this.startValue = null
-      this.endValue = null
-      this.queryParam.brandTypeBeginDate = undefined
-      this.queryParam.brandTypeEndDate = undefined
+      this.form.monthInfo = [this.moment().format('YYYY-MM'), this.moment().format('YYYY-MM')]
+      this.startValue = this.moment().format('YYYY-MM')
+      this.endValue = this.moment().format('YYYY-MM')
+      this.queryParam.brandTypeBeginDate = this.moment().format('YYYYMM')
+      this.queryParam.brandTypeEndDate = this.moment().format('YYYYMM')
       this.queryParam.dealerSn = undefined
       this.queryParam.provinceSn = undefined
       this.queryParam.subareaArea.subareaSn = undefined
       this.queryParam.subareaArea.subareaAreaSn = undefined
       this.queryParam.subareaArea.bizUserSn = undefined
-      this.queryParam.productBrandSn = undefined
+      this.queryParam.productBrand = undefined
       this.queryParam.productTypeSn1 = undefined
-      this.queryParam.product_type = undefined
+      this.queryParam.productType = undefined
       this.queryParam.dealerType = undefined
 
       this.productType = []