Explorar o código

全国品类实售明细报表对接

zhangdan %!s(int64=3) %!d(string=hai) anos
pai
achega
ab248db072

+ 34 - 0
src/api/reportData.js

@@ -419,3 +419,37 @@ export const reportSalesReturnThjdReportExport = (params) => {
     responseType: 'blob'
   })
 }
+// 全国各省类销售明细报表
+export const realReportSalesByProvince = (params) => {
+  return axios({
+    url: '/report/realReportSales/queryListByProvince',
+    data: params,
+    method: 'post'
+  })
+}
+// 导出
+export const realReportSalesByProvinceExport = (params) => {
+  return axios({
+    url: '/report/realReportSales/exportByProvince',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}
+// 全国各区类销售明细报表
+export const realReportSalesBySubArea = (params) => {
+  return axios({
+    url: '/report/realReportSales/queryListBySubArea',
+    data: params,
+    method: 'post'
+  })
+}
+// 导出
+export const realReportSalesBySubAreaExport = (params) => {
+  return axios({
+    url: '/report/realReportSales/exportBySubArea',
+    data: params,
+    method: 'post',
+    responseType: 'blob'
+  })
+}

+ 150 - 75
src/config/router.config.js

@@ -1275,6 +1275,31 @@ export const asyncRouterMap = [
               }
             ]
           },
+          {
+            path: '/reportData/regionTypeSalesReport',
+            redirect: '/reportData/regionTypeSalesReport/list',
+            name: 'regionTypeSalesReport',
+            component: BlankLayout,
+            meta: {
+              title: '各省品类实售明细',
+              icon: 'profile'
+              // permission: 'M_nationalCustomerCostStatisticsList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'regionTypeSalesReportList',
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionTypeSalesReport/list.vue'),
+                meta: {
+                  title: '各省品类实售明细',
+                  icon: 'profile',
+                  hidden: true
+                  // permission: 'M_nationalCustomerCostStatisticsList'
+                }
+              }
+            ]
+          },
           {
             path: '/reportData/provinceTypeSalesDetails',
             redirect: '/reportData/provinceTypeSalesDetails/list',
@@ -1424,82 +1449,132 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          },
-          {
-            path: '/reportData/districtTypeSalesDetails',
-            redirect: '/reportData/districtTypeSalesDetails/list',
-            name: 'districtTypeSalesDetails',
-            component: BlankLayout,
-            meta: {
-              title: '全国各区品类实际销售明细',
-              icon: 'profile',
-              permission: 'M_districtTypeSalesDetailsList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'districtTypeSalesDetailsList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/districtTypeSalesDetails/list.vue'),
-                meta: {
-                  title: '全国各区品类实际销售明细列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_districtTypeSalesDetailsList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/regionalPromotionCostStatistics',
-            redirect: '/reportData/regionalPromotionCostStatistics/list',
-            name: 'regionalPromotionCostStatistics',
-            component: BlankLayout,
-            meta: {
-              title: '区域促销费用统计',
-              icon: 'profile',
-              permission: 'M_regionalPromotionCostStatisticsList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'regionalPromotionCostStatisticsList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionalPromotionCostStatistics/list.vue'),
-                meta: {
-                  title: '区域促销费用统计列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_regionalPromotionCostStatisticsList'
-                }
-              }
-            ]
-          },
-          {
-            path: '/reportData/nationalCustomerCostStatistics',
-            redirect: '/reportData/nationalCustomerCostStatistics/list',
-            name: 'nationalCustomerCostStatistics',
-            component: BlankLayout,
-            meta: {
-              title: '全国客户费用统计',
-              icon: 'profile',
-              permission: 'M_nationalCustomerCostStatisticsList'
-            },
-            hideChildrenInMenu: true,
-            children: [
-              {
-                path: 'list',
-                name: 'nationalCustomerCostStatisticsList',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/nationalCustomerCostStatistics/list.vue'),
-                meta: {
-                  title: '全国客户费用统计列表',
-                  icon: 'profile',
-                  hidden: true,
-                  permission: 'M_nationalCustomerCostStatisticsList'
-                }
-              }
-            ]
           }
+          // {
+          //   path: '/reportData/districtTypeSalesDetails',
+          //   redirect: '/reportData/districtTypeSalesDetails/list',
+          //   name: 'districtTypeSalesDetails',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '全国各区品类实际销售明细',
+          //     icon: 'profile',
+          //     permission: 'M_districtTypeSalesDetailsList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'districtTypeSalesDetailsList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/districtTypeSalesDetails/list.vue'),
+          //       meta: {
+          //         title: '全国各区品类实际销售明细列表',
+          //         icon: 'profile',
+          //         hidden: true,
+          //         permission: 'M_districtTypeSalesDetailsList'
+          //       }
+          //     }
+          //   ]
+          // },
+          // {
+          //   path: '/reportData/regionalPromotionCostStatistics',
+          //   redirect: '/reportData/regionalPromotionCostStatistics/list',
+          //   name: 'regionalPromotionCostStatistics',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '区域促销费用统计',
+          //     icon: 'profile',
+          //     permission: 'M_regionalPromotionCostStatisticsList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'regionalPromotionCostStatisticsList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/regionalPromotionCostStatistics/list.vue'),
+          //       meta: {
+          //         title: '区域促销费用统计列表',
+          //         icon: 'profile',
+          //         hidden: true,
+          //         permission: 'M_regionalPromotionCostStatisticsList'
+          //       }
+          //     }
+          //   ]
+          // },
+          // {
+          //   path: '/reportData/nationalCustomerCostStatistics',
+          //   redirect: '/reportData/nationalCustomerCostStatistics/list',
+          //   name: 'nationalCustomerCostStatistics',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '全国客户费用统计',
+          //     icon: 'profile',
+          //     permission: 'M_nationalCustomerCostStatisticsList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'nationalCustomerCostStatisticsList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/nationalCustomerCostStatistics/list.vue'),
+          //       meta: {
+          //         title: '全国客户费用统计列表',
+          //         icon: 'profile',
+          //         hidden: true,
+          //         permission: 'M_nationalCustomerCostStatisticsList'
+          //       }
+          //     }
+          //   ]
+          // },
+          // {
+          //   path: '/reportData/provinceTypeSalesDetails',
+          //   redirect: '/reportData/provinceTypeSalesDetails/list',
+          //   name: 'provinceTypeSalesDetails',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '全国各省品类实际销售明细',
+          //     icon: 'profile',
+          //     permission: 'M_provinceTypeSalesDetailsList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'provinceTypeSalesDetailsList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/provinceTypeSalesDetails/list.vue'),
+          //       meta: {
+          //         title: '全国各省品类实际销售明细列表',
+          //         icon: 'profile',
+          //         hidden: true,
+          //         permission: 'M_provinceTypeSalesDetailsList'
+          //       }
+          //     }
+          //   ]
+          // },
+          // {
+          //   path: '/reportData/allCountryCostReport',
+          //   redirect: '/reportData/allCountryCostReport/list',
+          //   name: 'allCountryCostReport',
+          //   component: BlankLayout,
+          //   meta: {
+          //     title: '全国费用统计报表',
+          //     icon: 'profile'
+          //     // permission: 'M_nationalCustomerCostStatisticsList'
+          //   },
+          //   hideChildrenInMenu: true,
+          //   children: [
+          //     {
+          //       path: 'list',
+          //       name: 'allCountryCostReportList',
+          //       component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/allCountryCostReport/list.vue'),
+          //       meta: {
+          //         title: '全国费用统计报表',
+          //         icon: 'profile',
+          //         hidden: true
+          //         // permission: 'M_nationalCustomerCostStatisticsList'
+          //       }
+          //     }
+          //   ]
+          // }
         ]
       },
       // 数据导出

+ 576 - 0
src/views/reportData/allCountryCostReport/list.vue

@@ -0,0 +1,576 @@
+<template>
+  <a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-tabs v-model="activeKey" type="card" @change="callback">
+        <a-tab-pane :key="item.id" :tab="item.name" v-for="item in tabsList">
+        </a-tab-pane>
+      </a-tabs>
+
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="returnGoodsPresentationList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <!-- <a-col :md="6" :sm="24">
+              <a-form-model-item label="创建时间" prop="time">
+                <a-date-picker
+                  style="width:100%"
+                  placeholder="请选择年份"
+                  format="YYYY"
+                  mode="year"
+                  :disabledDate="disabledDate"
+                  @change="onChange"
+                  :value="year"
+                  :open="open"
+                  @openChange="openChange"
+                  @panelChange="panelChange"
+                />
+              </a-form-model-item>
+            </a-col> -->
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="所在区域">
+                <subarea id="returnGoodsPresentationList-subareaSn" v-model="queryParam.dealer.subareaSn"></subarea>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-if="activeKey == 0">
+              <a-form-model-item prop="dealerProvinceSn" style="margin: 0;" label="地区">
+                <a-select v-model="queryParam.dealer.provinceSn" allowClear placeholder="请选择省">
+                  <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_returnGoodsPresentationExport')"
+                id="returnGoodsPresentationList-export">导出</a-button>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :defaultLoadData="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :showPagination="false"
+        :data="loadData"
+        :scroll="{ x: 2370 }"
+        bordered>
+        <template slot="footer">
+          <a-row>
+            <a-col span="2">合计:</a-col>
+            <a-col span="22">
+              <a-row>
+                <a-col span="4">1月:{{ (totalData && (totalData.jpYgpAmount || totalData.jpYgpAmount==0)) ? totalData.jpYgpAmount : '--' }}</a-col>
+                <a-col span="4">2月:{{ (totalData && (totalData.jpLbAmount || totalData.jpLbAmount==0)) ? totalData.jpLbAmount : '--' }}</a-col>
+                <a-col span="4">3月:{{ (totalData && (totalData.jpScpAmount || totalData.jpScpAmount==0)) ? totalData.jpScpAmount : '--' }}</a-col>
+                <a-col span="4">4月:{{ (totalData && (totalData.jpGyxAmount || totalData.jpGyxAmount==0)) ? totalData.jpGyxAmount : '--' }}</a-col>
+                <a-col span="4">5月:{{ (totalData && (totalData.gpYgpAmount || totalData.gpYgpAmount==0)) ? totalData.gpYgpAmount : '--' }}</a-col>
+                <a-col span="4">6月:{{ (totalData && (totalData.gpLqqAmount || totalData.gpLqqAmount==0)) ? totalData.gpLqqAmount : '--' }}</a-col>
+                <a-col span="4">7月:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">8月:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">9月:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">10月:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">11月:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">12月:{{ (totalData && (totalData.gpScpAmount || totalData.gpScpAmount==0)) ? totalData.gpScpAmount : '--' }}</a-col>
+                <a-col span="4">1-12月费用:{{ (totalData && (totalData.hjAmount || totalData.hjAmount==0)) ? totalData.hjAmount : '--' }}</a-col>
+                <a-col span="4">实际销售额:{{ (totalData && (totalData.dlsAmount || totalData.dlsAmount==0)) ? totalData.dlsAmount : '--' }}</a-col>
+                <a-col span="4">费用占比(%):{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">正常配送品费用:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">正常促销品费用:{{ (totalData && (totalData.wsAmount || totalData.wsAmount==0)) ? totalData.wsAmount : '--' }}</a-col>
+                <a-col span="4">特殊申请配送品费用:{{ (totalData && (totalData.tbuAmount || totalData.tbuAmount==0)) ? totalData.tbuAmount : '--' }}</a-col>
+                <a-col span="4">特殊申请促销品费用:{{ (totalData && (totalData.tbupAmount || totalData.tbupAmount==0)) ? totalData.tbupAmount : '--' }}</a-col>
+              </a-row>
+            </a-col>
+          </a-row>
+        </template>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { getArea } from '@/api/data'
+import subarea from '@/views/common/subarea.js'
+import { reportSalesReturnThjdReportList } from '@/api/reportData'
+import moment from 'moment'
+import reportData from '@/libs/reportData.js'
+export default {
+  components: { STable, VSelect, rangeDate, subarea, moment },
+  data () {
+    return {
+      spinning: false,
+      tabsList: [{ id: 0, name: '全国客户费用统计' }, { id: 1, name: '区域促销费用统计' }],
+      activeKey: 0,
+      open: false,
+      year: '',
+      queryParam: {
+        time: [],
+        beginDate: '',
+        endDate: '',
+        dealer: {
+          'dealerName': '',
+          'provinceSn': undefined,
+          'citySn': undefined,
+          'districtSn': undefined,
+          'subareaSn': undefined,
+          'dealerLevel': undefined
+        }
+      },
+      addrProvinceList: [], //  省下拉
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      rules: {
+        'time': [{ required: true, message: '请选择月份', trigger: 'change' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        const _this = this
+        _this.disabled = true
+        _this.spinning = true
+        return new Promise(function (resolve, reject) {
+          const data = {
+            list: reportData.nationalCustomerCostStatisticsList
+          }
+          for (var i = 0; i < data.list.length; i++) {
+            data.list[i].no = i + 1
+          }
+          _this.spinning = false
+          _this.disabled = false
+          resolve(data)
+        })
+
+        // const paramsPage = Object.assign(this.queryParam) //  有分页
+        // return reportSalesReturnThjdReportList(paramsPage).then(res => {
+        //   let data
+        //   if (res.status == 200) {
+        //     data = res.data
+        //     // this.getCount(paramsPage)
+        //     const no = (data.pageNo - 1) * data.pageSize
+        //     for (var i = 0; i < data.list.length; i++) {
+        //       data.list[i].no = no + i + 1
+        //     }
+        //     this.disabled = false
+        //   }
+        //   this.spinning = false
+        //   return data
+        // })
+      },
+      totalData: null
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        {
+          title: '区域',
+          dataIndex: 'area',
+          width: 200,
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          }
+        },
+        {
+          title: '客户名称',
+          dataIndex: '',
+          align: 'center',
+          customRender: function (text) {
+            return text || '--'
+          },
+          ellipsis: true
+        },
+        {
+          title: '费用类型',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '1月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '2月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '3月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '4月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '5月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '6月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '7月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '8月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '9月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '10月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '11月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '12月',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '1-12月费用合计',
+          dataIndex: '',
+          width: 140,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '实际销售额合计',
+          dataIndex: '',
+          width: 140,
+          align: 'center',
+          customRender: (value, row, index) => {
+            const obj = {
+              children: value,
+              attrs: {}
+            }
+            if (index === 0) {
+              obj.attrs.rowSpan = 5
+            }
+            if (index === 1) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 2) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 3) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 4) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 5) {
+              obj.attrs.rowSpan = 5
+            }
+            if (index === 6) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 7) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 8) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 9) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 10) {
+              obj.attrs.rowSpan = 5
+            }
+            if (index === 11) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 12) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 13) {
+              obj.attrs.rowSpan = 0
+            }
+            if (index === 14) {
+              obj.attrs.rowSpan = 0
+            }
+            return obj
+          }
+        },
+        {
+          title: '费用占比(%)',
+          dataIndex: '',
+          width: 140,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '正常配送品费用',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '正常促销品费用',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '特殊申请配送品费用',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        },
+        {
+          title: '特殊申请促销品费用',
+          dataIndex: '',
+          width: 120,
+          align: 'center',
+          customRender: function (text) {
+            return ((text || text == 0) ? text : '--')
+          }
+        }
+      ]
+      if (this.activeKey == 0) {
+        arr.splice(1, 0, { title: '省份', dataIndex: 'province', width: 90, align: 'center', customRender: function (text) { return text || '--' } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    callback (key) {
+      this.activeKey = key
+      console.log(key, this.activeKey)
+    },
+    onChange (date, dateString) {
+      console.log(date, dateString)
+    },
+    openChange (status) {
+      if (status) {
+        this.open = true
+      } else {
+        this.open = false
+      }
+    },
+    panelChange (value) {
+      this.year = value
+      this.open = false
+    },
+    // 禁止选择的年份
+    disabledDate (currentDate) {
+      console.log(currentDate)
+      return currentDate && currentDate < moment().endOf('year')
+    },
+    // 分页
+
+    // 查询省
+    getProvinceData (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          console.log(res, '=============地区')
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = []
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.dealer = {
+        'dealerName': '',
+        'provinceSn': undefined,
+        'citySn': undefined,
+        'districtSn': undefined,
+        'subareaSn': undefined,
+        'dealerLevel': undefined
+      }
+      this.totalData = null
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(reportRebateExport, params, '全国各省品类实际销售明细报表', function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    pageInit () {
+      this.activeKey = 0
+      this.getProvinceData('province')
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      // this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      // this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style style="less">
+  .regionTypeSalesReportList-wrap{
+
+  }
+</style>

+ 4 - 7
src/views/reportData/nationalCustomerCostStatistics/list.vue

@@ -360,6 +360,8 @@ export default {
         }
       }
       ],
+      allocateTypeList: [], //  调拨类型
+      openModal: false, //  新增编辑  弹框
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -375,10 +377,7 @@ export default {
         const _this = this
         return new Promise(function (resolve, reject) {
           const data = {
-            pageNo: 1,
-            pageSize: 10,
-            list: reportData.nationalCustomerCostStatisticsList,
-            count: 10
+            list: reportData.nationalCustomerCostStatisticsList
           }
           for (var i = 0; i < data.list.length; i++) {
             data.list[i].no = i + 1
@@ -386,9 +385,7 @@ export default {
           _this.disabled = false
           resolve(data)
         })
-      },
-      allocateTypeList: [], //  调拨类型
-      openModal: false //  新增编辑  弹框
+      }
     }
   },
   methods: {

+ 293 - 0
src/views/reportData/regionTypeSalesReport/list.vue

@@ -0,0 +1,293 @@
+<template>
+  <a-card>
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-tabs v-model="activeKey" type="card" @change="callback">
+        <a-tab-pane :key="item.id" :tab="item.name" v-for="item in tabsList">
+        </a-tab-pane>
+      </a-tabs>
+      <div class="table-page-search-wrapper">
+        <a-form-model
+          id="returnGoodsPresentationList-form"
+          ref="ruleForm"
+          class="form-model-con"
+          layout="inline"
+          :rules="rules"
+          :model="queryParam"
+          @keyup.enter.native="handleSearch">
+          <a-row :gutter="15">
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="审核时间" prop="time">
+                <rangeDate ref="rangeDate" :value="queryParam.time" @change="dateChange"/>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24" v-if=" activeKey==0">
+              <a-form-model-item label="所在区域">
+                <subarea id="returnGoodsPresentationList-subareaSn" v-model="queryParam.subareaSn"></subarea>
+              </a-form-model-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-model-item label="销售状态">
+                <a-select v-model="queryParam.salesStatusType" allowClear placeholder="请选择省">
+                  <a-select-option v-for="item in salesStatusTypeList" :value="item.code" :key="item.code">{{ item.name }}</a-select-option>
+                </a-select>
+              </a-form-model-item>
+              </a-form-model-item>
+            </a-col>
+            <template v-if="advanced && activeKey==0">
+              <a-col :md="6" :sm="24">
+                <a-form-model-item prop="dealerProvinceSn" style="margin: 0;" label="地区">
+                  <a-select v-model="queryParam.dealerProvinceSn" allowClear placeholder="请选择省">
+                    <a-select-option v-for="item in addrProvinceList" :value="item.areaSn" :key="item.areaSn + 'a'">{{ item.name }}</a-select-option>
+                  </a-select>
+                </a-form-model-item>
+              </a-col>
+            </template>
+            <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
+              <a-button type="primary" @click="handleSearch" :disabled="disabled" id="returnGoodsPresentationList-refresh">查询</a-button>
+              <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="returnGoodsPresentationList-reset">重置</a-button>
+              <a-button
+                style="margin-left: 5px"
+                type="primary"
+                class="button-warning"
+                @click="handleExport"
+                :disabled="disabled"
+                :loading="exportLoading"
+                v-if="$hasPermissions('B_returnGoodsPresentationExport')"
+                id="returnGoodsPresentationList-export">导出</a-button>
+              <a @click="advanced=!advanced" style="margin-left: 5px" v-if="activeKey==0">
+                {{ advanced ? '收起' : '展开' }}
+                <a-icon :type="advanced ? 'up' : 'down'"/>
+              </a>
+            </a-col>
+          </a-row>
+        </a-form-model>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable"
+        ref="table"
+        size="small"
+        :defaultLoadData="false"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :showPagination="false"
+        :scroll="{ x: 1550 }"
+        bordered>
+      </s-table>
+    </a-spin>
+  </a-card>
+</template>
+
+<script>
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { getArea } from '@/api/data'
+import subarea from '@/views/common/subarea.js'
+import { hdExportExcel } from '@/libs/exportExcel'
+import { realReportSalesByProvince, realReportSalesByProvinceExport, realReportSalesBySubArea, realReportSalesBySubAreaExport } from '@/api/reportData.js'
+export default {
+  components: { STable, VSelect, rangeDate, subarea },
+  data () {
+    return {
+      spinning: false,
+      tabsList: [{ id: 0, name: '各省品类实售明细' }, { id: 1, name: '各区品类实售明细' }],
+      salesStatusTypeList: [{ code: 'SALES', name: '实售销售' }, { code: 'SALES_RETURN', name: '实收退货' }, { code: 'REAL_SALES', name: '实际销售' }],
+      activeKey: 0,
+      advanced: true, // 高级搜索 展开/关闭
+      queryParam: {
+        time: [],
+        beginDate: '',
+        endDate: '',
+        dealerProvinceSn: undefined,
+        subareaSn: undefined,
+        salesStatusType: 'REAL_SALES'
+      },
+      addrProvinceList: [], //  省下拉
+      disabled: false, //  查询、重置按钮是否可操作
+      exportLoading: false,
+      rules: {
+        'time': [{ required: true, message: '请选择审核时间', trigger: 'change' }]
+      },
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        const paramsPage = Object.assign(this.queryParam) //  无分页
+        const jkUrl = this.activeKey == 0 ? realReportSalesByProvince : realReportSalesBySubArea
+        return jkUrl(paramsPage).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+          }
+          this.disabled = false
+          this.spinning = false
+          return data
+        })
+      }
+    }
+  },
+  computed: {
+    columns () {
+      const arr = [
+        { title: '区域',
+          dataIndex: 'subareaNames',
+          width: 50,
+          align: 'center',
+          customRender: function (text) { return text || '--' }
+        },
+        { title: '销售状态', dataIndex: 'salesStatus', width: 50, align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '箭牌滤清器', dataIndex: 'jpLqqAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '冠牌滤清器', dataIndex: 'gpLqqAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '滤清器合计', dataIndex: 'lqqAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '箭牌雨刮片', dataIndex: 'jpYgpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '冠牌雨刮片', dataIndex: 'gpYgpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '雨刮片合计', dataIndex: 'ygpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '箭牌刹车片', dataIndex: 'jpScpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '箭牌感应线', dataIndex: 'jpGyxAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '冠牌刹车片', dataIndex: 'gpScpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: 'TBU刹车片', dataIndex: 'tbuScpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: 'TBU刹车油', dataIndex: 'tbuScyAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: 'TBU感应线', dataIndex: 'tbuGyxAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '刹车片合计', dataIndex: 'scpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: 'TBU-P', dataIndex: 'tbupAmount', align: 'center', width: 50, customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '德路斯润滑油', dataIndex: 'dlsRhyAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '德路斯刹车油', dataIndex: 'dlsScyAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '德路斯变速箱油', dataIndex: 'dlsBsxyAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '德路斯合计', dataIndex: 'dlsAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '稳升点火线圈', dataIndex: 'wsDhxqAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '稳升灯泡', dataIndex: 'wsDpAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '稳升合计', dataIndex: 'wsAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '汇箭', dataIndex: 'hjAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '布瑞斯', dataIndex: 'brsAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '箭牌喇叭', dataIndex: 'jpLbAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '品牌合计', dataIndex: 'ppAmount', width: 70, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: 'NGK', dataIndex: 'ngkAmount', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '品牌+NGK总合计', dataIndex: 'ppAndNgkAmount', width: 80, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+      ]
+      if (this.activeKey == 0) {
+        arr.splice(1, 0, { title: '省份', dataIndex: 'dealerProvinceName', width: 50, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } })
+      }
+      return arr
+    }
+  },
+  methods: {
+    callback (key) {
+      this.activeKey = key
+      this.queryParam.time = []
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+      console.log(key, this.activeKey)
+    },
+    // 查询省
+    getProvinceData (leve, sn) {
+      let params
+      if (leve == 'province') {
+        params = { type: '2' }
+      } else {
+        params = { parentId: sn, type: leve == 'city' ? '3' : '4' }
+      }
+      getArea(params).then(res => {
+        if (res.status == 200) {
+          console.log(res, '=============地区')
+          if (leve == 'province') {
+            this.addrProvinceList = res.data || []
+          } else if (leve == 'city') {
+            this.addrCityList = res.data || []
+          } else if (leve == 'district') {
+            this.addrDistrictList = res.data || []
+          }
+        } else {
+          if (leve == 'province') {
+            this.addrProvinceList = []
+          } else if (leve == 'city') {
+            this.addrCityList = []
+          } else if (leve == 'district') {
+            this.addrDistrictList = []
+          }
+        }
+      })
+    },
+    //  创建时间  change
+    dateChange (date) {
+      if (date[0] && date[1]) {
+        this.queryParam.time = date
+      } else {
+        this.queryParam.time = []
+      }
+      this.queryParam.beginDate = date[0] || ''
+      this.queryParam.endDate = date[1] || ''
+    },
+    // 查询
+    handleSearch () {
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.$refs.table.refresh(true)
+        } else {
+          return false
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.queryParam.time = []
+      this.$refs.rangeDate.resetDate(this.queryParam.time)
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.dealerProvinceSn = undefined
+      this.queryParam.subareaSn = undefined
+      this.queryParam.salesStatusType = 'REAL_SALES'
+      this.$refs.ruleForm.resetFields()
+      this.$refs.table.clearTable()
+    },
+    //  导出
+    handleExport () {
+      const _this = this
+      const jkUrl = _this.activeKey == 0 ? realReportSalesByProvinceExport : realReportSalesBySubAreaExport
+      const excelTitle = _this.activeKey == 0 ? '各省品类实售明细报表' : '各区品类实售明细报表'
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          const params = _this.queryParam
+          _this.exportLoading = true
+          _this.spinning = true
+          hdExportExcel(jkUrl, params, excelTitle, function () {
+            _this.exportLoading = false
+            _this.spinning = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    pageInit () {
+      this.activeKey = 0
+      this.getProvinceData('province')
+      this.resetSearchForm()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      // this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      // this.resetSearchForm()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+
+<style style="less">
+  .regionTypeSalesReportList-wrap{
+
+  }
+</style>