Forráskód Böngészése

实售销售、退货

chenrui 2 éve
szülő
commit
9a1d6fba41

+ 12 - 4
src/api/reportData.js

@@ -55,9 +55,17 @@ export const salesReportReturnCount = (params) => {
   })
 }
 
+// 实售退货报表 biao题
+export const salesReportReturnRebateTitle = (params) => {
+  return axios({
+    url: '/report/returnSsthReport/reportTitle',
+    data: params,
+    method: 'get'
+  })
+}
 //  实售退货报表
 export const salesReportReturnRebateList = (params) => {
-  const url = `/report/salesReturnBillReport/returnRebateQueryPage/${params.pageNo}/${params.pageSize}`
+  const url = `/report/returnDocReport/reportPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -69,7 +77,7 @@ export const salesReportReturnRebateList = (params) => {
 //  实售退货报表  合计
 export const salesReportReturnRebateCount = (params) => {
   return axios({
-    url: '/report/salesReturnBillReport/returnRebateQuerySum',
+    url: '/report/returnDocReport/reportCount',
     data: params,
     method: 'post'
   })
@@ -225,7 +233,7 @@ export const salesAmountExport = (params) => {
 // 实售销售 导出
 export const actualSalesExport = (params) => {
   return axios({
-    url: '/report/salesBillReport/totalRealExportExcel',
+    url: '/report/salesSsxs/reportExport',
     data: params,
     method: 'post',
     responseType: 'blob'
@@ -243,7 +251,7 @@ export const billingReturnExport = (params) => {
 // 实售退货 导出
 export const salesReturnExport = (params) => {
   return axios({
-    url: '/report/salesReturnBillReport/returnRebateExportExcel',
+    url: '/report/returnSsthReport/reportExport',
     data: params,
     method: 'post',
     responseType: 'blob'

+ 10 - 3
src/api/salesBillReport.js

@@ -66,10 +66,17 @@ export const salesBillReportCountByBuyer = (params) => {
     method: 'post'
   })
 }
-
+// 实售销售报表 biao头
+export const salesBillRealReportTitle = (params) => {
+  return axios({
+    url: '/report/salesSsxs/reportTitle',
+    data: params,
+    method: 'get'
+  })
+}
 // 实售销售报表
 export const salesBillRealAmountQueryPageList = (params) => {
-  const url = `/report/salesBillReport/realAmountQueryPageGroupByBuyer/${params.pageNo}/${params.pageSize}`
+  const url = `/report/salesSsxs/reportPage/${params.pageNo}/${params.pageSize}`
   delete params.pageNo
   delete params.pageSize
   return axios({
@@ -82,7 +89,7 @@ export const salesBillRealAmountQueryPageList = (params) => {
 //  实售销售报表   合计
 export const salesBillRealReportCount = (params) => {
   return axios({
-    url: '/report/salesBillReport/totalRealAmount',
+    url: '/report/salesSsxs/reportCount',
     data: params,
     method: 'post'
   })

+ 11 - 11
src/config/router.config.js

@@ -1993,8 +1993,8 @@ export const asyncRouterMap = [
             component: BlankLayout,
             meta: {
               title: '开单采退报表',
-              icon: 'profile'
-              // permission: 'M_billingBackReportList'
+              icon: 'profile',
+              permission: 'M_billingBackReport'
             },
             hideChildrenInMenu: true,
             children: [{
@@ -2004,8 +2004,8 @@ export const asyncRouterMap = [
               meta: {
                 title: '开单采退报表列表',
                 icon: 'profile',
-                hidden: true
-                // permission: 'M_billingBackReportList'
+                hidden: true,
+                permission: 'M_billingBackReportList'
               }
             }]
           },
@@ -2016,8 +2016,8 @@ export const asyncRouterMap = [
             component: BlankLayout,
             meta: {
               title: '开单采退单报表',
-              icon: 'profile'
-              // permission: 'M_billingOrderReportList'
+              icon: 'profile',
+              permission: 'M_billingOrderReport'
             },
             hideChildrenInMenu: true,
             children: [{
@@ -2027,8 +2027,8 @@ export const asyncRouterMap = [
               meta: {
                 title: '开单采退单报表列表',
                 icon: 'profile',
-                hidden: true
-                // permission: 'M_billingOrderReportList'
+                hidden: true,
+                permission: 'M_billingOrderReportList'
               }
             }]
           },
@@ -2341,7 +2341,7 @@ export const asyncRouterMap = [
         component: PageView,
         meta: {
           title: '产品返利表',
-          icon: 'profile',
+          icon: 'profile'
           // permission: 'M_productRebateReport'
         },
         children: [
@@ -2352,7 +2352,7 @@ export const asyncRouterMap = [
             component: BlankLayout,
             meta: {
               title: '产品返利明细表',
-              icon: 'profile',
+              icon: 'profile'
               // permission: 'M_productRebateReportList'
             },
             hideChildrenInMenu: true,
@@ -2364,7 +2364,7 @@ export const asyncRouterMap = [
                 meta: {
                   title: '产品返利明细表',
                   icon: 'profile',
-                  hidden: true,
+                  hidden: true
                   // permission: 'M_productRebateReportList'
                 }
               }

+ 28 - 236
src/views/reportData/actualSalesReport/list.vue

@@ -81,30 +81,9 @@
             <a-col span="2">合计:</a-col>
             <a-col span="22">
               <a-row>
-                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? toThousands(totalData.jpLqqAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌变速箱滤清器:{{ (totalData && (totalData.jpBsxLqqAmount || totalData.jpBsxLqqAmount==0)) ? toThousands(totalData.jpBsxLqqAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? toThousands(totalData.jpLbAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? toThousands(totalData.jpScpAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? toThousands(totalData.jpGyxAmount) : '--' }}</a-col>
-                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
-                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
-                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? toThousands(totalData.gpScpAmount) : '--' }}</a-col>
-                <a-col span="4">稳升点火线圈:{{ (totalData && (totalData.wsDhxqAmount || totalData.wsDhxqAmount==0)) ? toThousands(totalData.wsDhxqAmount) : '--' }}</a-col>
-                <a-col span="4">稳升灯泡:{{ (totalData && (totalData.wsDpAmount || totalData.wsDpAmount==0)) ? toThousands(totalData.wsDpAmount) : '--' }}</a-col>
-                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? toThousands(totalData.hjAmount) : '--' }}</a-col>
-                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? toThousands(totalData.dlsAmount) : '--' }}</a-col>
-                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
-                <a-col span="4">TBU-P:{{ (totalData && (totalData.tbupAmount || totalData.tbupAmount==0)) ? toThousands(totalData.tbupAmount) : '--' }}</a-col>
-                <a-col span="4">布瑞斯:{{ (totalData && (totalData.brsAmount || totalData.brsAmount==0)) ? toThousands(totalData.brsAmount) : '--' }}</a-col>
-                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? toThousands(totalData.ngkAmount) : '--' }}</a-col>
-                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? toThousands(totalData.flpAmount) : '--' }}</a-col>
-                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? toThousands(totalData.cpAmount) : '--' }}</a-col>
-                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? toThousands(totalData.wetAmount) : '--' }}</a-col>
-                <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? toThousands(totalData.lbstAmount) : '--' }}</a-col>
-                <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? toThousands(totalData.defAmount) : '--' }}</a-col>
-                <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? toThousands(totalData.bndAmount) : '--' }}</a-col>
-                <a-col span="6">实售销售合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
+                <a-col span="4" v-for="item in countLabel" :key="item.key">
+                  {{ item.title }}:{{ totalData?totalData[item.dataIndex]:'--' }}
+                </a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -126,7 +105,7 @@ import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
+import { salesBillRealReportTitle, salesBillRealAmountQueryPageList, salesBillRealReportCount } from '@/api/salesBillReport'
 import { actualSalesExport } from '@/api/reportData'
 export default {
   name: 'ActualSalesReportList',
@@ -184,214 +163,8 @@ export default {
         })
       },
       totalData: null,
-      addrProvinceList: [], //  省下拉
-      addrCityList: [], //  市下拉
-      addrDistrictList: [] //  区下拉
-    }
-  },
-  computed: {
-    columns () {
-      const _this = this
-      const arr = [
-        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 90, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
-        { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealer.dealerName', width: 100, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 100, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌',
-          align: 'center',
-          children: [
-            {
-              title: '箭牌',
-              align: 'center',
-              children: [
-                {
-                  title: '滤清器',
-                  dataIndex: 'jpLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '变速箱滤清器',
-                  dataIndex: 'jpBsxLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '雨刮片',
-                  dataIndex: 'jpYgpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '喇叭',
-                  dataIndex: 'jpLbAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '刹车片',
-                  dataIndex: 'jpScpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '感应线',
-                  dataIndex: 'jpGyxAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '冠牌',
-              align: 'center',
-              children: [
-                {
-                  title: '滤清器',
-                  dataIndex: 'gpLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '雨刮片',
-                  dataIndex: 'gpYgpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '刹车片',
-                  dataIndex: 'gpScpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '稳升',
-              align: 'center',
-              children: [
-                {
-                  title: '点火线圈',
-                  dataIndex: 'wsDhxqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '灯泡',
-                  dataIndex: 'wsDpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '汇箭',
-              dataIndex: 'hjAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '德路斯',
-              dataIndex: 'dlsAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: 'TBU',
-              dataIndex: 'tbuAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: 'TBU-P',
-              dataIndex: 'tbupAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '布瑞斯',
-              dataIndex: 'brsAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            }
-          ]
-        },
-        { title: '代理品牌',
-          align: 'center',
-          children: [
-            {
-              title: 'NGK',
-              dataIndex: 'ngkAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '飞利浦',
-              dataIndex: 'flpAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '车仆',
-              dataIndex: 'cpAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '瓦尔塔',
-              dataIndex: 'wetAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '雷贝斯托',
-              dataIndex: 'lbstAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '德尔福',
-              dataIndex: 'defAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '巴诺德',
-              dataIndex: 'bndAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            }
-          ]
-        }
-        // { title: '实售销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ?  _this.toThousands(text) : '--' } }
-      ]
-      if (this.$hasPermissions('M_actualSalesReportList_salesPrice')) { //  售价权限
-        arr.splice(arr.length, 0, { title: '实售销售合计金额', width: 90, dataIndex: 'totalAmount', align: 'right', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } })
-      }
-      return arr
+      columns: [],
+      countLabel: []
     }
   },
   methods: {
@@ -449,7 +222,7 @@ export default {
     custChange (val) {
       this.queryParam.dealer.dealerSn = val.key
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.dealer.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.dealer.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -484,17 +257,36 @@ export default {
       this.queryParam.dealer.provinceSn = val[0] ? val[0] : ''
       this.queryParam.dealer.citySn = val[1] ? val[1] : ''
       this.queryParam.dealer.districtSn = val[2] ? val[2] : ''
+    },
+    // 获取表头
+    async getTableTitle () {
+      const _this = this
+      const tableTitle = await salesBillRealReportTitle().then(res => res.data)
+      this.columns = tableTitle.list
+      this.countLabel = tableTitle.count
+      this.columns.map(item => {
+        let mw = 40
+        if (item.customRender == 'amount') {
+          mw = 15
+          item.customRender = function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
+        }
+        const w = item.title.length * mw
+        const tw = w <= 80 && item.customRender != 'amount' ? w * 2 : (w >= 360 ? 200 : w)
+        item.width = tw + 'px'
+        this.tableWidth = this.tableWidth + tw
+      })
+      this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.resetSearchForm()
+      this.getTableTitle()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.resetSearchForm()
+      this.getTableTitle()
     }
   },
   beforeRouteEnter (to, from, next) {

+ 32 - 234
src/views/reportData/salesReturnReport/list.vue

@@ -41,7 +41,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="地区">
-                    <AreaList id="salesReturnDetailList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
+                  <AreaList id="salesReturnDetailList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
                 </a-form-model-item>
               </a-col>
             </template>
@@ -81,31 +81,9 @@
             <a-col span="2">合计:</a-col>
             <a-col span="22">
               <a-row>
-                <a-col span="4">箭牌滤清器:{{ (totalData && (totalData.jpLqqAmount || totalData.jpLqqAmount==0)) ? toThousands(totalData.jpLqqAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌变速箱滤清器:{{ (totalData && (totalData.jpBsxLqqAmount || totalData.jpBsxLqqAmount==0)) ? toThousands(totalData.jpBsxLqqAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌雨刮片:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? toThousands(totalData.jpYgpAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌喇叭:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? toThousands(totalData.jpLbAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌刹车片:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ?toThousands(totalData.jpScpAmount) : '--' }}</a-col>
-                <a-col span="4">箭牌感应线:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? toThousands(totalData.jpGyxAmount) : '--' }}</a-col>
-                <a-col span="4">冠牌滤清器:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? toThousands(totalData.gpLqqAmount) : '--' }}</a-col>
-                <a-col span="4">冠牌雨刮片:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? toThousands(totalData.gpYgpAmount) : '--' }}</a-col>
-                <a-col span="4">冠牌刹车片:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? toThousands(totalData.gpScpAmount) : '--' }}</a-col>
-                <a-col span="4">稳升点火线圈:{{ (totalData && (totalData.wsDhxqAmount || totalData.wsDhxqAmount==0)) ? toThousands(totalData.wsDhxqAmount) : '--' }}</a-col>
-                <a-col span="4">稳升灯泡:{{ (totalData && (totalData.wsDpAmount || totalData.wsDpAmount==0)) ? toThousands(totalData.wsDpAmount) : '--' }}</a-col>
-                <a-col span="4">汇箭:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? toThousands(totalData.hjAmount) : '--' }}</a-col>
-                <a-col span="4">德路斯:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? toThousands(totalData.dlsAmount) : '--' }}</a-col>
-                <a-col span="4">TBU:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? toThousands(totalData.tbuAmount) : '--' }}</a-col>
-                <a-col span="4">TBU-P:{{ (totalData && (totalData.tbupAmount || totalData.tbupAmount==0)) ? toThousands(totalData.tbupAmount) : '--' }}</a-col>
-                <a-col span="4">布瑞斯:{{ (totalData && (totalData.brsAmount || totalData.brsAmount==0)) ? toThousands(totalData.brsAmount) : '--' }}</a-col>
-                <a-col span="4">NGK:{{ (totalData && (totalData.ngkAmount || totalData.ngkAmount==0)) ? toThousands(totalData.ngkAmount) : '--' }}</a-col>
-                <a-col span="4">飞利浦:{{ (totalData && (totalData.flpAmount || totalData.flpAmount==0)) ? toThousands(totalData.flpAmount) : '--' }}</a-col>
-                <a-col span="4">车仆:{{ (totalData && (totalData.cpAmount || totalData.cpAmount==0)) ? toThousands(totalData.cpAmount) : '--' }}</a-col>
-                <a-col span="4">瓦尔塔:{{ (totalData && (totalData.wetAmount || totalData.wetAmount==0)) ? toThousands(totalData.wetAmount) : '--' }}</a-col>
-                <a-col span="4">雷贝斯托:{{ (totalData && (totalData.lbstAmount || totalData.lbstAmount==0)) ? toThousands(totalData.lbstAmount) : '--' }}</a-col>
-                <a-col span="4">德尔福:{{ (totalData && (totalData.defAmount || totalData.defAmount==0)) ? toThousands(totalData.defAmount) : '--' }}</a-col>
-                <a-col span="4">巴诺德:{{ (totalData && (totalData.bndAmount || totalData.bndAmount==0)) ? toThousands(totalData.bndAmount) : '--' }}</a-col>
-                <!-- v-if="$hasPermissions('B_isShowPrice')" -->
-                <a-col span="6">实售退货合计金额:{{ (totalData && (totalData.totalAmount || totalData.totalAmount==0)) ? toThousands(totalData.totalAmount) : '--' }}</a-col>
+                <a-col span="4" v-for="item in countLabel" :key="item.key">
+                  {{ item.title }}:{{ totalData?totalData[item.dataIndex]:'--' }}
+                </a-col>
               </a-row>
             </a-col>
           </a-row>
@@ -127,7 +105,7 @@ import reportModal from '@/views/common/reportModal.vue'
 import subarea from '@/views/common/subarea.js'
 import AreaList from '@/views/common/areaList.js'
 import { hdExportExcel } from '@/libs/exportExcel'
-import { salesReportReturnRebateList, salesReportReturnRebateCount, salesReturnExport } from '@/api/reportData'
+import { salesReportReturnRebateTitle, salesReportReturnRebateList, salesReportReturnRebateCount, salesReturnExport } from '@/api/reportData'
 
 export default {
   name: 'SalesReturnReportList',
@@ -187,208 +165,9 @@ export default {
         })
       },
       productType: [],
-      totalData: null
-    }
-  },
-  computed: {
-    columns () {
-      const _this = this
-      const arr = [
-        { title: '区域', dataIndex: 'dealer.subareaNameSet', width: 120, align: 'center', customRender: function (text) { return (text && text.length > 0) ? text.join('/') : '--' } },
-        { title: '省份', dataIndex: 'dealer.provinceName', width: 90, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '客户名称', dataIndex: 'dealer.dealerName', width: 120, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'dealer.dealerLevelDictValue', width: 120, align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '品牌',
-          align: 'center',
-          children: [
-            {
-              title: '箭牌',
-              align: 'center',
-              children: [
-                {
-                  title: '滤清器',
-                  dataIndex: 'jpLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '变速箱滤清器',
-                  dataIndex: 'jpBsxLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '雨刮片',
-                  dataIndex: 'jpYgpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '喇叭',
-                  dataIndex: 'jpLbAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '刹车片',
-                  dataIndex: 'jpScpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '感应线',
-                  dataIndex: 'jpGyxAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '冠牌',
-              align: 'center',
-              children: [
-                {
-                  title: '滤清器',
-                  dataIndex: 'gpLqqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '雨刮片',
-                  dataIndex: 'gpYgpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '刹车片',
-                  dataIndex: 'gpScpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '稳升',
-              align: 'center',
-              children: [
-                {
-                  title: '点火线圈',
-                  dataIndex: 'wsDhxqAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                },
-                {
-                  title: '灯泡',
-                  dataIndex: 'wsDpAmount',
-                  align: 'right',
-                  width: 80,
-                  customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-                }
-              ]
-            },
-            {
-              title: '汇箭',
-              dataIndex: 'hjAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '德路斯',
-              dataIndex: 'dlsAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: 'TBU',
-              dataIndex: 'tbuAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: 'TBU-P',
-              dataIndex: 'tbupAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '布瑞斯',
-              dataIndex: 'brsAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            }
-          ] },
-        { title: '代理品牌',
-          align: 'center',
-          children: [
-            {
-              title: 'NGK',
-              dataIndex: 'ngkAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '飞利浦',
-              dataIndex: 'flpAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '车仆',
-              dataIndex: 'cpAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '瓦尔塔',
-              dataIndex: 'wetAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '雷贝斯托',
-              dataIndex: 'lbstAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '德尔福',
-              dataIndex: 'defAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            },
-            {
-              title: '巴诺德',
-              dataIndex: 'bndAmount',
-              align: 'right',
-              width: 80,
-              customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
-            }
-          ] }
-        // { title: '实售退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return (text || text == 0) ?  _this.toThousands(text) : '--' } }
-      ]
-      arr.splice(arr.length, 0, { title: '实售退货合计金额', width: 90, dataIndex: 'totalAmount', align: 'right', customRender: function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' } })
-      return arr
+      totalData: null,
+      columns: [],
+      countLabel: []
     }
   },
   methods: {
@@ -428,7 +207,7 @@ export default {
         if (valid) {
           _this.$refs.table.refresh(true)
         } else {
-          _this.$message.error("请选择退货日期")
+          _this.$message.error('请选择退货日期')
           return false
         }
       })
@@ -446,7 +225,7 @@ export default {
     custChange (val) {
       this.queryParam.dealerSn = val.key
     },
-    subareaChange(val){
+    subareaChange (val) {
       this.queryParam.subareaSn = val[0] ? val[0] : undefined
       this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
     },
@@ -475,21 +254,40 @@ export default {
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
     },
-    areaChange(val){
+    areaChange (val) {
       this.queryParam.provinceSn = val[0] ? val[0] : ''
       this.queryParam.citySn = val[1] ? val[1] : ''
       this.queryParam.districtSn = val[2] ? val[2] : ''
+    },
+    // 获取表头
+    async getTableTitle () {
+      const _this = this
+      const tableTitle = await salesReportReturnRebateTitle().then(res => res.data)
+      this.columns = tableTitle.list
+      this.countLabel = tableTitle.count
+      this.columns.map(item => {
+        let mw = 40
+        if (item.customRender == 'amount') {
+          mw = 15
+          item.customRender = function (text) { return (text || text == 0) ? _this.toThousands(text) : '--' }
+        }
+        const w = item.title.length * mw
+        const tw = w <= 80 && item.customRender != 'amount' ? w * 2 : (w >= 360 ? 200 : w)
+        item.width = tw + 'px'
+        this.tableWidth = this.tableWidth + tw
+      })
+      this.resetSearchForm()
     }
   },
   mounted () {
     if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.resetSearchForm()
+      this.getTableTitle()
     }
   },
   activated () {
     // 如果是新页签打开,则重置当前页面
     if (this.$store.state.app.isNewTab) {
-      this.resetSearchForm()
+      this.getTableTitle()
     }
   },
   beforeRouteEnter (to, from, next) {