123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372 |
- <template>
- <div>
- <a-card size="small" :bordered="false" class="customerFeeList-wrap searchBoxNormal">
-
- <div class="table-page-search-wrapper" ref="tableSearch">
- <a-form-model
- id="customerFeeList-form"
- ref="ruleForm"
- class="form-model-con"
- layout="inline"
- :rules="rules"
- :model="queryParam">
- <a-row :gutter="15">
- <a-col :md="6" :sm="24">
- <a-form-model-item label="月份" prop="queryDate">
- <a-month-picker
- id="customerFeeList-monthBox"
- class="monthBox"
- :disabled-date="disabledDate"
- v-model="monthVal"
- placeholder="请选择月份"
- @change="onChangeMonth" />
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="客户名称">
- <dealerSubareaScopeList ref="dealerSubareaScopeList" id="customerFeeList-dealerName" @change="custChange" />
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="客户级别">
- <v-select
- v-model="queryParam.dealerLevel"
- ref="dealerLevel"
- id="customerFeeList-dealerLevel"
- code="DEALER_LEVEL"
- placeholder="请选择客户级别"
- allowClear></v-select>
- </a-form-model-item>
- </a-col>
- <template v-if="advanced">
- <a-col :md="6" :sm="24">
- <a-form-item label="所在区域">
- <subarea id="customerFeeList-subarea" ref="subarea" @change="subareaChange"></subarea>
- </a-form-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="区域负责人">
- <BizUser id="customerFeeList-bizUserSn" v-model="queryParam.subareaArea.bizUserSn"></BizUser>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="地区">
- <AreaList id="customerFeeList-areaList" changeOnSelect ref="areaList" @change="areaChange" defValKey="id"></AreaList>
- </a-form-model-item>
- </a-col>
- <a-col :md="6" :sm="24">
- <a-form-model-item label="客服">
- <customerService ref="customerName" id="customerFeeList-customerName" v-model="queryParam.bizUserSn"></customerService>
- </a-form-model-item>
- </a-col>
- </template>
- <a-col :md="6" :sm="24">
- <a-button
- type="primary"
- @click="handleSearch"
- :disabled="disabled"
- id="customerFeeList-refresh">查询</a-button>
- <a-button
- style="margin-left: 8px"
- @click="resetSearchForm"
- :disabled="disabled"
- id="customerFeeList-reset">重置</a-button>
- <a-button
- style="margin-left: 10px"
- type="primary"
- class="button-warning"
- @click="handleExport"
- :disabled="disabled"
- :loading="exportLoading"
- v-if="$hasPermissions('B_tireFeeExport')"
- id="customerFeeList-export">导出</a-button>
- <a @click="advanced=!advanced" style="margin-left: 5px">
- {{ advanced ? '收起' : '展开' }}
- <a-icon :type="advanced ? 'up' : 'down'" />
- </a>
- </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"
- rowKeyName="no"
- :style="{ height: tableHeight+70+'px' }"
- :columns="columns"
- :data="loadData"
- :scroll="{x:2200, y: tableHeight-120}"
- :defaultLoadData="false"
- bordered>
- </s-table>
- </a-spin>
- </a-card>
- </div>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { hdExportExcel } from '@/libs/exportExcel'
- import moment from 'moment'
- import { STable, VSelect } from '@/components'
- import subarea from '@/views/common/subarea.js'
- import AreaList from '@/views/common/areaList.js'
- import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
- import BizUser from '@/views/common/bizUser.js'
- import customerService from '@/views/common/customerService.vue'
- import { tireFeeReportList, tireFeeReportCount, tireFeeListExport } from '@/api/reportData'
- export default {
- name: 'CustomerFeeList',
- mixins: [commonMixin],
- components: { STable, VSelect, subarea, AreaList, dealerSubareaScopeList, BizUser, customerService },
- data () {
- return {
- spinning: false,
- disabled: false,
- advanced: true,
- tableHeight: 0,
- exportLoading: false,
- monthVal: moment().format('YYYY-MM'),
-
- queryParam: {
- queryType: 'month',
- queryDate: moment().format('YYYYMM'),
- dealerLevel: undefined,
- customSn: undefined,
- dealerEntity: {
- dealerName: undefined,
- provinceSn: undefined,
- citySn: undefined,
- districtSn: undefined
- },
- subareaArea: {
- subareaSn: '',
- subareaAreaSn: '',
- bizUserSn: undefined
- },
- bizUserSn: undefined
- },
- totalData: null,
- rules: {
- 'queryDate': [{ required: true, message: '请选择查询月份', trigger: 'change' }]
- },
-
- loadData: parameter => {
- this.disabled = true
- this.spinning = true
- const params = Object.assign(parameter, this.queryParam)
-
- return tireFeeReportList(params).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
- })
- }
- }
- },
- watch: {
- advanced (newValue, oldValue) {
- const _this = this
- this.$nextTick(() => {
- _this.setTableH()
- })
- },
- '$store.state.app.winHeight' (newValue, oldValue) {
- this.setTableH()
- }
- },
- computed: {
- columns () {
- const _this = this
- const arr = [
- { title: '序号', dataIndex: 'no', width: '40px', align: 'center', fixed: 'left' },
- { title: '月份', dataIndex: 'monthData', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
- { title: '区域', dataIndex: 'subareaArea.subareaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
- { title: '分区', dataIndex: 'subareaArea.subareaAreaName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
- { title: '区域负责人', dataIndex: 'subareaArea.bizUserName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
- { title: '省份', dataIndex: 'dealerEntity.provinceName', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
- { title: '客户名称', dataIndex: 'dealerEntity.dealerName', width: '100px', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true, fixed: 'left' },
- { title: '客户级别', dataIndex: 'dealerEntity.dealerLevelDictValue', width: '80px', align: 'center', customRender: function (text) { return text || '--' }, fixed: 'left' },
- { title: '箭牌滤清器', dataIndex: 'serviceAmountProvince', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '箭牌变速箱滤清器', dataIndex: 'serviceAmountProvince1', width: '110px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '冠牌滤清器', dataIndex: 'serviceAmountProvince2', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '滤清器合计', dataIndex: 'serviceAmountProvince3', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '箭牌雨刮片', dataIndex: 'serviceAmountProvince4', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '箭牌雨燕雨刮片', dataIndex: 'serviceAmountProvince5', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '冠牌雨刮片', dataIndex: 'serviceAmountProvince6', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '雨刮片合计', dataIndex: 'serviceAmountProvince7', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '箭牌喇叭', dataIndex: 'serviceAmountProvince8', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '箭牌刹车片', dataIndex: 'serviceAmountProvince9', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: 'TBU+箭牌感应线', dataIndex: 'serviceAmountProvincea', width: '110px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '冠牌刹车片', dataIndex: 'serviceAmountProvincec', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: 'TBU刹车片', dataIndex: 'serviceAmountProvinceb', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: 'TBU至惠刹车片', dataIndex: 'serviceAmountProvinced', width: '110px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: 'TBU刹车油', dataIndex: 'serviceAmountProvincee', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: 'TBU-P刹车盘', dataIndex: 'serviceAmountProvincef', width: '110px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '制动系统合计', dataIndex: 'serviceAmountProvinceg', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '汇箭蓄电池', dataIndex: 'serviceAmountProvinceh', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '布瑞斯蓄电池', dataIndex: 'serviceAmountProvincei', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '蓄电池合计', dataIndex: 'serviceAmountProvincej', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '德路斯机油', dataIndex: 'serviceAmountProvincek21', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '德路斯变速箱油', dataIndex: 'serviceAmountProvincek', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '德路斯刹车油', dataIndex: 'serviceAmountProvincel', width: '90px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '德路斯汽车养护产品', dataIndex: 'serviceAmountProvincem', width: '120px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '科润星机油', dataIndex: 'serviceAmountProvince12', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '油品合计', dataIndex: 'serviceAmountProvince13', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '稳升点火线圈', dataIndex: 'serviceAmountProvince14', width: '100px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '稳升LED灯', dataIndex: 'serviceAmountProvince15', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '稳升合计', dataIndex: 'serviceAmountProvince16', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '全品类', dataIndex: 'serviceAmountProvince17', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '品牌合计', dataIndex: 'serviceAmountProvince99', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '轮胎', dataIndex: 'serviceAmountProvince18', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: 'NGk火花塞', dataIndex: 'serviceAmountProvince19', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
- { title: '全品类(含轮胎、NGM)', dataIndex: 'serviceAmountProvince22', width: '80px', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
- ]
- return arr
- }
- },
- methods: {
-
- disabledDate (current) {
- return current && current >= moment().endOf('day')
- },
-
- onChangeMonth (date, dateString) {
- this.monthVal = dateString
- if (date && dateString != '') {
- this.queryParam.queryDate = dateString.replace('-', '')
- } else {
- this.queryParam.queryDate = void 0
- }
- },
-
- handleSearch () {
- const _this = this
- this.$refs.ruleForm.validate(valid => {
- if (valid) {
- _this.$refs.table.refresh(true)
- } else {
- _this.$message.error('请选择查询月份')
- return false
- }
- })
- },
-
- custChange (val) {
- this.queryParam.dealerEntity.dealerName = val.name
- this.queryParam.customSn = val.key
- },
-
- areaChange (val) {
- this.queryParam.dealerEntity.provinceSn = val[0] ? val[0] : undefined
- this.queryParam.dealerEntity.citySn = val[1] ? val[1] : undefined
- this.queryParam.dealerEntity.districtSn = val[2] ? val[2] : undefined
- },
-
- subareaChange (val) {
- this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : ''
- this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : ''
- },
-
- resetSearchForm () {
- this.queryParam.queryType = 'month'
- this.monthVal = moment().format('YYYY-MM')
- this.queryParam.queryDate = moment().format('YYYYMM')
- this.queryParam.dealerEntity.provinceSn = undefined
- this.queryParam.dealerEntity.citySn = undefined
- this.queryParam.dealerEntity.districtSn = undefined
- this.queryParam.dealerEntity.dealerName = undefined
- this.queryParam.customSn = undefined
- this.queryParam.bizUserSn = undefined
- this.queryParam.subareaArea.subareaSn = ''
- this.queryParam.subareaArea.subareaAreaSn = ''
- this.queryParam.subareaArea.bizUserSn = undefined
- this.queryParam.dealerLevel = undefined
- this.queryParam.provinceFlag = undefined
- this.$refs.subarea.clearData()
- if (this.advanced) {
- this.$refs.dealerSubareaScopeList.resetForm()
- }
- this.totalData = null
- this.$refs.areaList.clearData()
- this.$refs.table.clearTable()
- this.$refs.ruleForm.resetFields()
- },
-
- handleExport () {
- const _this = this
- this.$refs.ruleForm.validate(valid => {
- if (valid) {
- _this.exportList()
- } else {
- _this.$message.error('请选择查询月份')
- return false
- }
- })
- },
-
- exportList () {
- const _this = this
- const params = JSON.parse(JSON.stringify(_this.queryParam))
- _this.exportLoading = true
- _this.spinning = true
- hdExportExcel(tireFeeListExport, params, '轮胎月度费用报表', function () {
- _this.exportLoading = false
- _this.spinning = false
- })
- },
-
- pageInit () {
- this.$nextTick(() => {
- this.setTableH()
- })
- this.resetSearchForm()
- },
-
- setTableH () {
- const tableSearchH = this.$refs.tableSearch.offsetHeight
- this.tableHeight = window.innerHeight - tableSearchH - 280
- }
- },
- mounted () {
- if (!this.$store.state.app.isNewTab) {
- this.pageInit()
- }
- },
- activated () {
-
- if (this.$store.state.app.isNewTab) {
- this.pageInit()
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .monthBox{
- width: 100%;
- /deep/.ant-calendar-picker-icon{
- display:none !important;
- }
- /deep/.ant-calendar-picker input{
- text-align:center;
- }
- }
- </style>
|