chenrui 1 rok pred
rodič
commit
8d1b607969

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

@@ -1836,22 +1836,22 @@ export const asyncRouterMap = [
           },
           {
             path: '/reportData/tireSalesReport',
-            redirect: '/reportData/tireSalesReport/index',
+            redirect: '/reportData/tireSalesReport/list',
             name: 'tireSalesReport',
             component: BlankLayout,
             meta: {
-              title: '轮胎销售统计报表',
+              title: '轮胎统计报表',
               icon: 'profile',
               permission: 'M_tireSalesReportList'
             },
             hideChildrenInMenu: true,
             children: [
               {
-                path: 'index',
+                path: 'list',
                 name: 'tireSalesReportIndex',
-                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/tireSalesReport/index.vue'),
+                component: () => import(/* webpackChunkName: "reportData" */ '@/views/reportData/tireSalesReport/list.vue'),
                 meta: {
-                  title: '轮胎销售统计报表',
+                  title: '轮胎统计报表',
                   icon: 'profile',
                   hidden: true,
                   permission: 'M_tireSalesReportList'

+ 0 - 303
src/views/reportData/tireSalesReport/index.vue

@@ -1,303 +0,0 @@
-<template>
-  <div>
-    <a-spin :spinning="spinning" tip="Loading...">
-      <a-tabs default-active-key="1" @change="handleChange" :tabBarStyle="{'background':'#fff'}">
-        <a-tab-pane key="1" tab="轮胎销售报表(客户)">
-          <dealerList></dealerList>
-        </a-tab-pane>
-        <a-tab-pane key="2" tab="轮胎销售报表(区域/分区)" force-render>
-          <subareaList></subareaList>
-        </a-tab-pane>
-      </a-tabs>
-      <!-- 导出提示框 -->
-      <reportModal :visible="showExport" @close="showExport=false"></reportModal>
-    </a-spin>
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import { STable, VSelect } from '@/components'
-import reportModal from '@/views/common/reportModal.vue'
-import { salesPromoReportList, salesPromoReportQueryCount, exportSalesPromoReport } from '@/api/reportData'
-import { hdExportExcel } from '@/libs/exportExcel'
-import subareaList from './subareaList'
-import dealerList from './dealerList'
-import rangeDate from '@/views/common/rangeDate.vue'
-import getDate from '@/libs/getDate.js'
-import subarea from '@/views/common/subarea.js'
-import AreaList from '@/views/common/areaList.js'
-// import moment from 'moment'
-export default {
-  name: 'PriceDifferenceDetailReportList',
-  mixins: [commonMixin],
-  components: { STable, VSelect, subareaList, dealerList, reportModal, AreaList, rangeDate, subarea },
-  data () {
-    const _this = this
-    return {
-      advanced: true, // 高级搜索 展开/关闭
-      time: undefined,
-      spinning: false,
-      queryParam: {
-        salesDate: [
-          getDate.getCurrMonthDays().starttime,
-          getDate.getCurrMonthDays().endtime
-        ],
-        beginAuditDate: getDate.getCurrMonthDays().starttime, // 审核开始时间
-        endAuditDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
-        promoRuleReport: {
-          promotionDateStart: undefined, // 促销时间-开始
-          promotionDateEnd: undefined, // 促销时间-结束
-          title: '', // 促销名称
-          promotionRuleType: undefined, // 促销类型
-          ruleInfo: ''// 规则
-        },
-        salesBillNo: '', // 销售单号
-        buyerLevel: undefined, // 客户级别
-        buyerName: '', // 客户名称
-        subareaArea: {
-          subareaSn: '',
-          subareaAreaSn: ''
-        },
-        dealerProvinceSn: undefined, // 省份编码
-        dealerCitySn: undefined, // 城市编码
-        dealerDistrictSn: undefined // 区域编码
-      },
-      rules: {
-        salesDate: [{ required: true, message: '请选择销售审核时间', trigger: 'change' }]
-      },
-      dateFormat: 'YYYY-MM-DD',
-      tabVal: 1,
-      disabled: false,
-      tableHeight: 0,
-      totalData: null, //  合计
-      exportLoading: false,
-      showExport: false,
-      columns: [
-        { title: '促销名称', dataIndex: 'promotion.title', width: '160px', align: 'left', customRender: function (text) { return text || '--' }, fixed: 'left', ellipsis: true },
-        { title: '促销时间', scopedSlots: { customRender: 'promotionTime' }, width: '130px', align: 'center', fixed: 'left' },
-        { title: '费用所属部门', dataIndex: 'departmentName', width: '160px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
-        { title: '促销类型', dataIndex: 'promotionRule.promotionRuleTypeDictValue', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '规则', dataIndex: 'promotionRule.ruleInfo', width: '180px', align: 'left', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '销售单号', dataIndex: 'salesBillNo', width: '120px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
-        { title: '区域', dataIndex: 'subareaArea.subareaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '地区', dataIndex: 'provinceName', width: '160px', align: 'center', scopedSlots: { customRender: 'addressInfo' } },
-        { title: '客户名称', dataIndex: 'buyerName', width: '140px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户级别', dataIndex: 'buyerLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '销售审核时间', dataIndex: 'auditDate', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '数量(非促)', dataIndex: 'notGiftQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '数量(促)', dataIndex: 'giftQty', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '实售金额', dataIndex: 'totalRealAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '开单金额', dataIndex: 'totalAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '成本金额', dataIndex: 'totalRealCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '损失成本', dataIndex: 'lossCost', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '损失费用', dataIndex: 'lossAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '采购额结余', dataIndex: 'surplusPromoGiftsAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '采购额超出', dataIndex: 'outPromoGiftsAmount', width: '100px', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
-        { title: '促销品费用归属品牌', dataIndex: 'promoProductBrandName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '促销品费用归属分类', dataIndex: 'promoProductTypeName', width: '120px', align: 'center', customRender: function (text) { return text || '--' } }
-      ],
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        const params = Object.assign(parameter, this.queryParam)
-        const newParams = JSON.parse(JSON.stringify(params))
-        delete newParams.salesDate
-        this.spinning = true
-        return salesPromoReportList(newParams).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            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
-        })
-      }
-    }
-  },
-  methods: {
-    salesDateChange (date) {
-      if (date[0] && date[1]) {
-        this.queryParam.salesDate = date
-      } else {
-        this.queryParam.salesDate = []
-      }
-      this.queryParam.beginAuditDate = date[0] || ''
-      this.queryParam.endAuditDate = date[1] || ''
-    },
-    dateChange (date, dateString) {
-      this.time = date
-      if (dateString[0] != '' && dateString[1] != '') {
-        this.queryParam.promoRuleReport.promotionDateStart = dateString[0] + ' 00:00:00'
-        this.queryParam.promoRuleReport.promotionDateEnd = dateString[1] + ' 23:59:59'
-      } else {
-        this.$set(this.queryParam.promoRuleReport, 'promotionDateStart', undefined)
-        this.$set(this.queryParam.promoRuleReport, 'promotionDateEnd', undefined)
-      }
-    },
-    // // 不可选日期
-    // disabledDate (date, dateStrings) {
-    //   return date && date.valueOf('day') < moment().subtract(1, 'day') // 今天以后,包含今天
-    // },
-    // 统计
-    getCount (params) {
-      salesPromoReportQueryCount(params).then(res => {
-        if (res.status == 200) {
-          this.totalData = res.data
-        } else {
-          this.totalData = null
-        }
-      })
-    },
-    subareaChange (val) {
-      this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
-    },
-    // tab
-    handleChange (val) {
-      this.tabVal = val
-    },
-    // 导出
-    handleExport () {
-      const _this = this
-      const params = this.queryParam
-      _this.exportLoading = true
-      _this.spinning = true
-      const ajaxUrl = _this.tabVal == 1 ? exportSalesPromoReport : exportSalesPromoRealReport
-      const ajaxName = _this.tabVal == 1 ? '促销销售单报表导出' : '促销销售单实时报表导出'
-      hdExportExcel(ajaxUrl, params, ajaxName, function () {
-        _this.exportLoading = false
-        _this.spinning = false
-        _this.showExport = true
-      })
-    },
-    // 验证表单 type值  search查询 export导出
-    testForm (type) {
-      const _this = this
-      if (!_this.queryParam.salesDate[0] || !_this.queryParam.salesDate[1]) {
-        _this.$message.error('请选择销售审核时间')
-        return
-      }
-      _this.$refs.ruleForm.validate(valid => {
-        if (valid) {
-          if (type == 'search') {
-            _this.handleSearch()
-          } else {
-            _this.handleExport()
-          }
-        } else {
-          _this.$message.error('请选择销售审核时间')
-          return false
-        }
-      })
-    },
-    areaChange (val) {
-      this.queryParam.dealerProvinceSn = val[0] ? val[0] : ''
-      this.queryParam.dealerCitySn = val[1] ? val[1] : ''
-      this.queryParam.dealerDistrictSn = val[2] ? val[2] : ''
-    },
-    // 查询
-    handleSearch () {
-      const _this = this
-      // 总计
-      const paramData = JSON.parse(JSON.stringify(this.queryParam))
-      delete paramData.salesDate
-      _this.getCount(paramData)
-      _this.$refs.table.refresh(true)
-    },
-    // 重置
-    resetSearchForm () {
-      this.$refs.ruleForm.resetFields()
-      this.queryParam = {
-        salesDate: [
-          getDate.getCurrMonthDays().starttime,
-          getDate.getCurrMonthDays().endtime
-        ],
-        beginAuditDate: getDate.getCurrMonthDays().starttime, // 审核开始时间
-        endAuditDate: getDate.getCurrMonthDays().endtime, // 审核结束时间
-        promoRuleReport: {
-          promotionDateStart: undefined, // 促销时间-开始
-          promotionDateEnd: undefined, // 促销时间-结束
-          title: '', // 促销名称
-          promotionRuleType: undefined, // 促销类型
-          ruleInfo: ''// 规则
-        },
-        salesBillNo: '', // 销售单号
-        buyerLevel: undefined, // 客户级别
-        buyerName: '', // 客户名称
-        subareaArea: {
-          subareaSn: '',
-          subareaAreaSn: ''
-        },
-        dealerProvinceSn: undefined, // 省份编码
-        dealerCitySn: undefined, // 城市编码
-        dealerDistrictSn: undefined // 区域编码
-      }
-      this.time = undefined
-      this.$refs.subarea.clearData()
-      this.$refs.areaList.clearData()
-      this.$refs.rangeDate.resetDate(this.queryParam.salesDate)
-      this.$refs.table.clearTable()
-      this.totalData = null
-    },
-    pageInit () {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-    },
-    setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 260
-    }
-  },
-  watch: {
-    advanced (newValue, oldValue) {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-    },
-    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
-      this.setTableH()
-    }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
-    }
-  },
-  activated () {
-    // 如果是新页签打开,则重置当前页面
-    if (this.$store.state.app.isNewTab) {
-      this.pageInit()
-    }
-  }
-}
-
-</script>
-
-<style lang="less" scoped>
-  .monthBox{
-    /deep/.ant-calendar-picker-icon{
-      display:none !important;
-    }
-    /deep/.ant-calendar-picker input{
-      text-align:center;
-    }
-  }
-  .promotionSalesRealTimeReport-wrap{
-    /deep/ .ant-card-body:first-child{
-      padding-bottom: 0;
-    }
-  }
-  .ant-tabs-tabpane.ant-tabs-tabpane-active{
-    margin-top:-11px !important;
-  }
-</style>

+ 15 - 16
src/views/reportData/tireSalesReport/dealerList.vue → src/views/reportData/tireSalesReport/list.vue

@@ -11,7 +11,7 @@
           :model="queryParam">
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
-              <a-form-model-item label="下推时间">
+              <a-form-model-item label="出库时间">
                 <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
@@ -28,11 +28,6 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-model-item label="客户名称">
-                  <!-- <a-input
-                    id="tireSalesDealerList-dealerName"
-                    v-model.trim="queryParam.dealerName"
-                    allowClear
-                    placeholder="请输入客户名称" /> -->
                   <dealerSubareaScopeList ref="dealerSubareaScopeList" id="tireSalesDealerList-dealerName" @change="custChange" />
                 </a-form-model-item>
               </a-col>
@@ -92,9 +87,9 @@
           </template>
           <template slot="footer">
             <a-row :gutter="15">
-              <a-col :md="4" :sm="24">采购数量:{{ (totalData && (totalData.totalbuyAmount || totalData.totalbuyAmount==0)) ? totalData.totalbuyAmount : '--' }}</a-col>
-              <a-col :md="4" :sm="24">库存数量:{{ (totalData && (totalData.totalstoreAmount || totalData.totalstoreAmount==0)) ? totalData.totalstoreAmount: '--' }}</a-col>
-              <a-col :md="4" :sm="24">售出数量:{{ (totalData && (totalData.totalsellAmount || totalData.totalsellAmount==0)) ?totalData.totalsellAmount: '--' }}</a-col>
+              <a-col :md="4" :sm="24">订货数量:{{ (totalData && (totalData.totalbuyAmount || totalData.totalbuyAmount==0)) ? totalData.totalbuyAmount : '--' }}</a-col>
+              <a-col :md="4" :sm="24">订货金额:{{ (totalData && (totalData.totalstoreAmount || totalData.totalstoreAmount==0)) ? toThousands(totalData.totalstoreAmount): '--' }}</a-col>
+              <a-col :md="4" :sm="24">库存数量:{{ (totalData && (totalData.totalsellAmount || totalData.totalsellAmount==0)) ?totalData.totalsellAmount: '--' }}</a-col>
               <a-col :md="4" :sm="24">已绑质保单数量:{{ (totalData && (totalData.totalwarrantyAmount || totalData.totalwarrantyAmount==0)) ?totalData.totalwarrantyAmount: '--' }}</a-col>
             </a-row>
           </template>
@@ -120,6 +115,7 @@ export default {
   mixins: [commonMixin],
   components: { STable, VSelect, rangeDate, subarea, AreaList, BizUser, dealerSubareaScopeList },
   data () {
+    const _this = this
     return {
       spinning: false,
       advanced: true, // 高级搜索 展开/关闭
@@ -169,13 +165,16 @@ export default {
         { title: '区域', dataIndex: 'subareaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '分区', dataIndex: 'subareaAreaName', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
         { title: '区域负责人', dataIndex: 'userNameQyfzrs', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '客户名称', dataIndex: 'dealerName', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '12%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '采购数量', dataIndex: 'buyAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'storeAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售出数量', dataIndex: 'sellAmount', width: '8%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已绑质保单数量', dataIndex: 'warrantyAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
+        { title: '客户名称', dataIndex: 'dealerName', width: '12%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '商户类型', dataIndex: 'dealerTypeDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '商户级别', dataIndex: 'dealerLevelDictValue', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品编码', dataIndex: 'buyAmount', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '原厂编码', dataIndex: 'storeAmount', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'sellAmount', width: '10%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
+        { title: '订货数量', dataIndex: 'sellAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '订货金额', dataIndex: 'sellAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
+        { title: '客户现有库存数量', dataIndex: 'sellAmount', width: '11%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
+        { title: '已绑质保单数量', dataIndex: 'warrantyAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
       ]
     }
   },

+ 0 - 231
src/views/reportData/tireSalesReport/subareaList.vue

@@ -1,231 +0,0 @@
-<template>
-  <div>
-    <a-card size="small" :bordered="false" class="tireSalesReportList-wrap searchBoxNormal">
-      <!-- 搜索条件 -->
-      <div class="table-page-search-wrapper" ref="tableSearch">
-        <a-form-model
-          id="tireSalesReportList-form"
-          ref="ruleForm"
-          class="form-model-con"
-          layout="inline"
-          :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="time" @change="dateChange" />
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-item label="区域/分区">
-                <subarea id="allocateBillList-subarea" ref="subarea" @change="subareaChange"></subarea>
-              </a-form-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-form-model-item label="区域负责人">
-                <BizUser v-model="queryParam.bizUserSn"></BizUser>
-              </a-form-model-item>
-            </a-col>
-            <a-col :md="6" :sm="24">
-              <a-button
-                style="margin-left: 5px"
-                type="primary"
-                @click="handleSearch"
-                :disabled="disabled"
-                id="salesOrderTotalList-refresh">查询</a-button>
-              <a-button
-                style="margin-left: 8px"
-                @click="resetSearchForm"
-                :disabled="disabled"
-                id="salesOrderTotalList-reset">重置</a-button>
-              <a-button
-                style="margin-left: 10px"
-                type="primary"
-                class="button-warning"
-                @click="handleExport"
-                :disabled="disabled"
-                :loading="exportLoading"
-                v-if="$hasPermissions('B_tireSalesAreaReportExport')"
-                id="salesOrderTotalList-export">导出</a-button>
-            </a-col>
-          </a-row>
-        </a-form-model>
-      </div>
-    </a-card>
-    <a-card size="small" :bordered="false">
-      <a-spin :spinning="spinning" tip="Loading...">
-        <!-- 列表 -->
-        <s-table
-          class="sTable fixPagination"
-          ref="table"
-          size="small"
-          :rowKey="(record) => record.no"
-          :style="{ height: tableHeight+70+'px' }"
-          rowKeyName="no"
-          :columns="columns"
-          :data="loadData"
-          :scroll="{ y: tableHeight-30 }"
-          :pageSize="30"
-          :defaultLoadData="false"
-          bordered>
-          <template slot="footer">
-            <a-row :gutter="15">
-              <a-col :md="4" :sm="24">采购数量:{{ (totalData && (totalData.totalbuyAmount || totalData.totalbuyAmount==0)) ? totalData.totalbuyAmount : '--' }}</a-col>
-              <a-col :md="4" :sm="24">库存数量:{{ (totalData && (totalData.totalstoreAmount || totalData.totalstoreAmount==0)) ? totalData.totalstoreAmount: '--' }}</a-col>
-              <a-col :md="4" :sm="24">售出数量:{{ (totalData && (totalData.totalsellAmount || totalData.totalsellAmount==0)) ?totalData.totalsellAmount: '--' }}</a-col>
-              <a-col :md="4" :sm="24">已绑质保单数量:{{ (totalData && (totalData.totalwarrantyAmount || totalData.totalwarrantyAmount==0)) ?totalData.totalwarrantyAmount: '--' }}</a-col>
-            </a-row>
-          </template>
-        </s-table>
-      </a-spin>
-    </a-card>
-  </div>
-</template>
-
-<script>
-import { commonMixin } from '@/utils/mixin'
-import getDate from '@/libs/getDate.js'
-import { STable } from '@/components'
-import rangeDate from '@/views/common/rangeDate.vue'
-import subarea from '@/views/common/subarea.js'
-import BizUser from '@/views/common/bizUser.js'
-import { hdExportExcel } from '@/libs/exportExcel'
-import { querySaleAreaCount, excelSaleAreaOnlineExport, querySaleAreaPage } from '@/api/reportData'
-export default {
-  name: 'TireSalesSubareaList',
-  mixins: [commonMixin],
-  components: { STable, rangeDate, subarea, BizUser },
-  data () {
-    return {
-      spinning: false,
-      tableHeight: 0,
-      time: [
-        getDate.getThreeMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ],
-      queryParam: { //  查询条件
-        beginDate: getDate.getThreeMonthDays().starttime,
-        endDate: getDate.getCurrMonthDays().endtime,
-        subareaSn: undefined,
-        subareaAreaSn: undefined,
-        bizUserSn: undefined
-      },
-      disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false,
-      // 加载数据方法 必须为 Promise 对象
-      loadData: parameter => {
-        this.disabled = true
-        this.spinning = true
-        const params = Object.assign(parameter, this.queryParam)
-        return querySaleAreaPage(params).then(res => {
-          let data
-          if (res.status == 200) {
-            data = res.data
-            this.getCount(params)
-            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,
-      columns: [
-        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
-        { title: '区域', dataIndex: 'subareaName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '分区', dataIndex: 'subareaAreaName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '区域负责人', dataIndex: 'userNameQyfzrs', width: '16%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
-        { title: '采购数量', dataIndex: 'buyAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '库存数量', dataIndex: 'storeAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '售出数量', dataIndex: 'sellAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
-        { title: '已绑质保单数量', dataIndex: 'warrantyAmount', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
-      ]
-    }
-  },
-  methods: {
-    // 统计
-    getCount (params) {
-      querySaleAreaCount(params).then(res => {
-        if (res.status == 200 && res.data) {
-          this.totalData = res.data
-        } else {
-          this.totalData = null
-        }
-      })
-    },
-    handleSearch () {
-      this.$refs.table.refresh(true)
-    },
-    //  下推时间  change
-    dateChange (date) {
-      if (date[0] && date[1]) {
-        this.time = date
-      } else {
-        this.time = []
-      }
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
-    },
-    subareaChange (val) {
-      this.queryParam.subareaSn = val[0] ? val[0] : undefined
-      this.queryParam.subareaAreaSn = val[1] ? val[1] : undefined
-    },
-    //  重置
-    resetSearchForm () {
-      this.time = [
-        getDate.getThreeMonthDays().starttime,
-        getDate.getCurrMonthDays().endtime
-      ]
-      this.$refs.rangeDate.resetDate(this.time)
-      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
-      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
-      this.queryParam.subareaSn = undefined
-      this.queryParam.subareaAreaSn = undefined
-      this.queryParam.bizUserSn = undefined
-      this.totalData = null
-      this.$refs.subarea.clearData()
-      this.$refs.table.clearTable()
-    },
-    //  导出
-    handleExport () {
-      const _this = this
-      const params = _this.queryParam
-      _this.exportLoading = true
-      _this.spinning = true
-      hdExportExcel(excelSaleAreaOnlineExport, params, '轮胎销售报表(区域/分区)', function () {
-        _this.exportLoading = false
-        _this.spinning = false
-      })
-    },
-    pageInit () {
-      const _this = this
-      this.$nextTick(() => { // 页面渲染完成后的回调
-        _this.setTableH()
-      })
-    },
-    setTableH () {
-      const tableSearchH = this.$refs.tableSearch.offsetHeight
-      this.tableHeight = window.innerHeight - tableSearchH - 245
-    }
-  },
-  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>